/** * Count comments * @return int */ public function countVisibleComments() { $criteria = Criteria::create(); $criteria->where(Criteria::expr()->neq('deleted', true)); return $this->comments->matching($criteria)->count(); }
public function removeComment(Comment $comment) { $this->comments->removeElement($comment); }
/** * Remove comment * * @param \Entities\Comment $comment */ public function removeComment(\Entities\Comment $comment) { $this->comments->removeElement($comment); }
/** * @param Comment $comment * @return $this */ public function removeComment(Comment $comment) { $this->comments->remove($comment); return $this; }
/** * @param Comment $comment */ public function removeComment(Comment $comment) { if ($this->comments->contains($comment)) { $this->comments->removeElement($comment); } }