コード例 #1
0
ファイル: Category.php プロジェクト: hafeez3000/orocommerce
 /**
  * @param Category $category
  *
  * @return $this
  */
 public function addChildCategory(Category $category)
 {
     if (!$this->childCategories->contains($category)) {
         $this->childCategories->add($category);
         $category->setParentCategory($this);
     }
     return $this;
 }
コード例 #2
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);
     }
 }
コード例 #3
0
ファイル: Category.php プロジェクト: arfr/OXIDConnectorBundle
 /**
  * Adds child category.
  *
  * @param Category $category
  *
  * @return Category
  */
 public function addChild(Category $category)
 {
     $this->children->add($category);
     return $this;
 }