Esempio n. 1
0
 /**
  * @param  ChildCategoryOption $categoryOption The ChildCategoryOption object to remove.
  * @return $this|ChildCategory The current object (for fluent API support)
  */
 public function removeCategoryOption(ChildCategoryOption $categoryOption)
 {
     if ($this->getCategoryOptions()->contains($categoryOption)) {
         $pos = $this->collCategoryOptions->search($categoryOption);
         $this->collCategoryOptions->remove($pos);
         if (null === $this->categoryOptionsScheduledForDeletion) {
             $this->categoryOptionsScheduledForDeletion = clone $this->collCategoryOptions;
             $this->categoryOptionsScheduledForDeletion->clear();
         }
         $this->categoryOptionsScheduledForDeletion[] = clone $categoryOption;
         $categoryOption->setCategory(null);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * @param  ChildCategoryOption $categoryOptionRelatedById The ChildCategoryOption object to remove.
  * @return $this|ChildCategoryOption The current object (for fluent API support)
  */
 public function removeCategoryOptionRelatedById(ChildCategoryOption $categoryOptionRelatedById)
 {
     if ($this->getCategoryOptionsRelatedById()->contains($categoryOptionRelatedById)) {
         $pos = $this->collCategoryOptionsRelatedById->search($categoryOptionRelatedById);
         $this->collCategoryOptionsRelatedById->remove($pos);
         if (null === $this->categoryOptionsRelatedByIdScheduledForDeletion) {
             $this->categoryOptionsRelatedByIdScheduledForDeletion = clone $this->collCategoryOptionsRelatedById;
             $this->categoryOptionsRelatedByIdScheduledForDeletion->clear();
         }
         $this->categoryOptionsRelatedByIdScheduledForDeletion[] = $categoryOptionRelatedById;
         $categoryOptionRelatedById->setCategoryOptionRelatedByParentId(null);
     }
     return $this;
 }