Beispiel #1
0
 /**
  * Returns the post pending comments
  *
  * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\T3extblog\Domain\Model\Comment> $comments
  */
 public function getPostPendingComments()
 {
     if ($this->postPendingComments === NULL) {
         $postPendingComments = $this->getCommentRepository()->findPendingByEmailAndPostId($this->email, $this->postUid);
         $this->postPendingComments = new ObjectStorage();
         foreach ($postPendingComments as $comment) {
             $this->postPendingComments->attach($comment);
         }
     }
     return $this->postPendingComments;
 }
Beispiel #2
0
 /**
  * Adds a Comment
  *
  * @param \TYPO3\T3extblog\Domain\Model\Comment $comment
  * @return void
  */
 public function addComment(Comment $comment)
 {
     $this->initComments();
     $comment->setPostId($this->getLocalizedUid());
     $this->comments->attach($comment);
     $this->getCommentRepository()->add($comment);
 }