Beispiel #1
0
 public function processCommentForm(Form $form, $values)
 {
     $this->comment = $this->comments->createEntity();
     $user = $this->users->getByID($this->getUser()->getId());
     $this->comment->setMessage($values->message);
     $this->comment->setArticle($this->article);
     $this->comment->setUser($user);
     $this->comments->persist($this->comment);
     $this->redirect('this');
 }
Beispiel #2
0
 public function updateModifiedField(Event $event, Comment $entity)
 {
     if ($entity->dirty('text') && !$entity->isNew()) {
         $entity->modified = new Time();
     }
 }