public function getNotifiableEntity(NotifiableInterface $notifiable)
    {
        $identifier = $this->generateIdentifier($notifiable);
        $class = ClassUtils::getRealClass(get_class($notifiable));
        $entity = $this->notifiableRepository->findOneBy(array(
            'identifier' => $identifier,
            'class' => $class
        ));

        if (!$entity) {
            $entity = new NotifiableEntity($identifier, $class);
            $this->om->persist($entity);
            $this->om->flush();
        }

        return $entity;
    }
public function getNotifiableEntity(NotifiableInterface $notifiable)
    {
        $identifier = $this->generateIdentifier($notifiable);
        $class = ClassUtils::getRealClass(get_class($notifiable));
        $entity = $this->notifiableRepository->findOneBy(array(
            'identifier' => $identifier,
            'class' => $class
        ));

        if (!$entity) {
            $entity = new NotifiableEntity($identifier, $class);
            $this->om->persist($entity);
            $this->om->flush();
        }

        return $entity;
    }
public function getNotifiableEntity ( NotifiableInterface $ notifiable ) { $ identifier = $ this -> generateIdentifier ( $ notifiable ) ; $ class = ClassUtils :: getRealClass ( get_class ( $ notifiable ) ) ; $ entity = $ this -> notifiableRepository -> findOneBy ( array ( 'identifier' => $ identifier , 'class' => $ class ) ) ; if ( ! $ entity ) { $ entity = new NotifiableEntity ( $ identifier , $ class ) ; $ this -> om -> persist ( $ entity ) ; $ this -> om -> flush ( ) ; } return $ entity ; }
Get a NotifiableEntity form a NotifiableInterface

@param NotifiableInterface $notifiable

@return NotifiableEntity
@throws \Doctrine\ORM\OptimisticLockException
@throws \Doctrine\ORM\ORMInvalidArgumentException
@throws \RuntimeException
@throws \InvalidArgumentException
Get a NotifiableEntity form a NotifiableInterface