Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setParent(CommentInterface $parent)
 {
     $this->parent = $parent;
     if (!$parent->getId()) {
         throw new InvalidArgumentException('Parent comment must be persisted.');
     }
     $ancestors = $parent->getAncestors();
     $ancestors[] = $parent->getId();
     $this->setAncestors($ancestors);
 }