Networking\InitCmsBundle\Entity\EntityChangedListener::getLoggingInfo PHP Method

getLoggingInfo() public method

public getLoggingInfo ( Doctrine\Common\EventArgs $args, string $method = '' ) : mixed | void
$args Doctrine\Common\EventArgs
$method string
return mixed | void
    public function getLoggingInfo(EventArgs $args, $method = '')
    {
        $entity = $args->getEntity();
        if ($this->getTokenStorage()->getToken() && $this->getTokenStorage()->getToken()->getUser() != 'anon.') {
            $username = $this->getTokenStorage()->getToken()->getUser()->getUsername();
        } else {
            $username = 'doctrine:fixtures:load!';
        }
        $id = method_exists($entity, 'getId') ? $entity->getId() : null;
        $this->logger->info(sprintf('entity %s', $method), array('username' => $username, 'class' => get_class($entity), 'id' => $id));
    }
EntityChangedListener