예제 #1
0
 /**
  * @param Term $term
  *
  * @return $this
  */
 public function addTerm(Term $term)
 {
     if (false === $this->terms->contains($term)) {
         $this->terms->add($term);
     }
     return $this;
 }
예제 #2
0
 /**
  * Collects terms where $prop matches $value
  *
  * @return ArrayCollection
  */
 protected function getTermsBy($prop, $value)
 {
     $criteria = new Criteria(Criteria::expr()->eq($prop, $value));
     return $this->terms->matching($criteria);
 }
예제 #3
0
 /**
  * @param string $key
  *
  * @return $this
  */
 public function removeTerm(Term $term)
 {
     $term->removeContentItem($this);
     $this->terms->removeElement($term);
     return $this;
 }