Classes/Netlogix/Cqrs/Log/CommandLogger.php
public function logCommand(AbstractCommand $command, \Exception $exception = null)
    {
        $commandLogEntry = $this->commandLogEntryRepository->findOneByCommand($command);
        $isNewObject = !$commandLogEntry;

        if ($isNewObject) {
            $commandLogEntry = new CommandLogEntry($command);
        }

        $commandLogEntry->setException($exception === null ? null : new ExceptionData($exception));

        if ($isNewObject) {
            $this->commandLogEntryRepository->add($commandLogEntry);
        } else {
            $this->commandLogEntryRepository->update($commandLogEntry);
        }
        $this->entityManager->flush($commandLogEntry);
    }
public function logCommand(AbstractCommand $command, \Exception $exception = null)
    {
        $commandLogEntry = $this->commandLogEntryRepository->findOneByCommand($command);
        $isNewObject = !$commandLogEntry;

        if ($isNewObject) {
            $commandLogEntry = new CommandLogEntry($command);
        }

        $commandLogEntry->setException($exception === null ? null : new ExceptionData($exception));

        if ($isNewObject) {
            $this->commandLogEntryRepository->add($commandLogEntry);
        } else {
            $this->commandLogEntryRepository->update($commandLogEntry);
        }
        $this->entityManager->flush($commandLogEntry);
    }
public function logCommand ( AbstractCommand $ command , \ Exception $ exception = null ) { $ commandLogEntry = $ this -> commandLogEntryRepository -> findOneByCommand ( $ command ) ; $ isNewObject = ! $ commandLogEntry ; if ( $ isNewObject ) { $ commandLogEntry = new CommandLogEntry ( $ command ) ; } $ commandLogEntry -> setException ( $ exception === null ? null : new ExceptionData ( $ exception ) ) ; if ( $ isNewObject ) { $ this -> commandLogEntryRepository -> add ( $ commandLogEntry ) ; } else { $ this -> commandLogEntryRepository -> update ( $ commandLogEntry ) ; } $ this -> entityManager -> flush ( $ commandLogEntry ) ; }
Log the given command

@param AbstractCommand $command
@param \Exception $exception
Log the given command