FIX: Adjusting to Flow 6.3 (Logger and EntityManager)
This commit is contained in:
parent
c180a50731
commit
e8b75b33dd
1 changed files with 6 additions and 14 deletions
|
@ -3,13 +3,12 @@
|
||||||
namespace DigiComp\Sequence\Service;
|
namespace DigiComp\Sequence\Service;
|
||||||
|
|
||||||
use DigiComp\Sequence\Domain\Model\Insert;
|
use DigiComp\Sequence\Domain\Model\Insert;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
|
||||||
use Doctrine\DBAL\DBALException;
|
use Doctrine\DBAL\DBALException;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Neos\Flow\Annotations as Flow;
|
use Neos\Flow\Annotations as Flow;
|
||||||
use Neos\Flow\Log\SystemLoggerInterface;
|
|
||||||
use Neos\Flow\Reflection\ReflectionService;
|
|
||||||
use Neos\Utility\TypeHandling;
|
use Neos\Utility\TypeHandling;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A SequenceNumber generator working for transactional databases
|
* A SequenceNumber generator working for transactional databases
|
||||||
|
@ -22,21 +21,14 @@ use Neos\Utility\TypeHandling;
|
||||||
class SequenceGenerator
|
class SequenceGenerator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var ObjectManager
|
|
||||||
* @Flow\Inject
|
* @Flow\Inject
|
||||||
|
* @var EntityManagerInterface
|
||||||
*/
|
*/
|
||||||
protected $entityManager;
|
protected $entityManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ReflectionService
|
|
||||||
* @Flow\Inject
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
protected $reflectionService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var SystemLoggerInterface
|
|
||||||
* @Flow\Inject
|
* @Flow\Inject
|
||||||
|
* @var LoggerInterface
|
||||||
*/
|
*/
|
||||||
protected $systemLogger;
|
protected $systemLogger;
|
||||||
|
|
||||||
|
@ -77,10 +69,10 @@ class SequenceGenerator
|
||||||
return false;
|
return false;
|
||||||
} catch (DBALException $e) {
|
} catch (DBALException $e) {
|
||||||
if (! $e->getPrevious() instanceof \PDOException) {
|
if (! $e->getPrevious() instanceof \PDOException) {
|
||||||
$this->systemLogger->logException($e);
|
$this->systemLogger->critical('Exception occured: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->systemLogger->logException($e);
|
$this->systemLogger->critical('Exception occured: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue