예제 #1
0
파일: Company.php 프로젝트: kulishkin/gis
 /**
  * @param Category $category
  */
 public function addCategory($category)
 {
     if (!$this->categories->contains($category)) {
         $category->addCompany($this);
         $this->categories[] = $category;
     }
 }
예제 #2
0
 /**
  * @param Category $category
  *
  * @return $this
  */
 public function removeChildCategory(Category $category)
 {
     if ($this->childCategories->contains($category)) {
         $this->childCategories->removeElement($category);
     }
     return $this;
 }
예제 #3
0
 /**
  * Add a category in the product association.
  * (Owning side).
  *
  * @param Category $category The category to associate
  */
 public function addCategory($category)
 {
     $category->addProduct($this);
     if (!$this->categories->contains($category)) {
         $this->categories->add($category);
     }
 }