예제 #1
0
 public function save(ContentInterface $content)
 {
     if (!$content->getId()) {
         $content->setAuthor($this->tokenStorage->getToken()->getUser());
     }
     return parent::save($content);
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 public function save(ContentInterface $content)
 {
     if (!$content->getId()) {
         $content->setAuthor($this->tokenStorage->getToken()->getUser());
         $this->em->persist($content);
     }
     $this->em->flush();
     return $content;
 }