/** * Remove articles * * @param Article $article */ public function removeArticle(Article $article) { if ($this->articles->contains($article)) { $this->articles->removeElement($article); $article->removeCitation($this); } }
/** * Remove item. * * @param \SWP\Component\Bridge\Model\Item $item */ public function removeItem(\SWP\Component\Bridge\Model\Item $item) { if ($this->items->contains($item)) { $this->items->removeElement($item); $item->setPackage(null); } }
/** * @param Role $parent */ public function addParent(Role $parent) { if ($this->parents->contains($parent)) { throw new LogicException(sprintf("Parent role '%s' already assigned.", $parent->getId())); } $this->parents->add($parent); }
/** * @param Archivo $archivo */ public function removeArchivo($archivo) { if ($this->archivos->contains($archivo)) { $this->archivos->removeElement($archivo); $archivo->setDocumentable(null); } }
/** * @param Empresa $empresa */ public function removeEmpresa($empresa) { if ($this->empresas->contains($empresa)) { $empresa->setDirector(null); $this->empresas->removeElement($empresa); } }
/** * @param ThirdParty $thirdParty * * @return bool */ public function addThirdParty(ThirdParty $thirdParty) { if ($this->thirdPartyCredentials->contains($thirdParty)) { return false; } return $this->thirdPartyCredentials->add($thirdParty); }
/** * Add tag * * @param TagInterface $tag Tag * * @return Product self Object */ public function addTag(TagInterface $tag) { if (!$this->tags->contains($tag)) { $tag->addProduct($this); $this->tags->add($tag); } return $this; }
/** * {@inheritdoc} */ public function save(TaskExecutionInterface $execution) { if ($this->taskExecutionCollection->contains($execution)) { return $this; } $this->taskExecutionCollection->add($execution); return $this; }
protected function syncNewAttributes(Collection $attributes) { $attributes->map(function (AttributeInterface $attribute) { if (false === $this->attributes->contains($attribute)) { $attribute->addValue($this); } }); }
/** * {@inheritdoc} */ public function save(TaskInterface $task) { if ($this->taskCollection->contains($task)) { return $this; } $this->taskCollection->add($task); return $this; }
/** * @param Scene $scene * * @return Chapter */ public function addScene(Scene $scene) { if (!$this->scenes->contains($scene)) { $scene->setChapter($this); $this->scenes->add($scene); } return $this; }
/** * @param User $user */ public function removeUser(User $user) { if (!$this->users->contains($user)) { return; } $this->users->removeElement($user); $user->removeGroup($this); }
/** * @param Chapter $chapter * * @return Book */ public function addChapter(Chapter $chapter) { if (!$this->chapters->contains($chapter)) { $this->chapters->add($chapter); $chapter->setBook($this); } return $this; }
/** * @param ApplicationUser $user * @return bool */ public function removeUser(ApplicationUser $user) { $bResult = true; if (!$this->users->contains($user)) { $bResult = false; } $this->users->removeElement($user); return $bResult; }
/** * @param \Doctrine\Tests\Models\Cache\Travel $item */ public function addTravel(Travel $item) { if (!$this->travels->contains($item)) { $this->travels->add($item); } if ($item->getTraveler() !== $this) { $item->setTraveler($this); } }
function it_does_transform_collection_with_objects_value(FakeEntity $entityOne, FakeEntity $entityTwo, FakeEntity $entityThree, FakeEntity $entityFour, Collection $collection) { $entityThree->getId()->willReturn(3); $entityFour->getId()->willReturn(4); $entityOne->getTaxons()->willReturn(array($entityThree)); $entityTwo->getTaxons()->willReturn(array($entityFour)); $collection->contains($entityThree)->willReturn(true); $collection->contains($entityFour)->willReturn(true); $this->transform($collection)->shouldReturn(array(1 => array($entityThree), 2 => array($entityFour))); }
/** * {@inheritdoc} */ public function removeTranslation(LayoutTranslationInterface $translation) { if ($this->translations instanceof Collection) { if ($this->translations->contains($translation)) { $this->translations->removeElement($translation); } } else { unset($this->translations[$translation->getLocale()]); } return $this; }
function it_does_transform_collection_with_objects_value($entityOne, $entityTwo, TaxonInterface $entityThree, TaxonInterface $entityFour, Collection $collection) { $entityThree->getId()->willReturn(3); $entityFour->getId()->willReturn(4); $entityOne->getTaxons()->willReturn([$entityThree]); $entityTwo->getTaxons()->willReturn([$entityFour]); $entityThree->getChildren()->willReturn([]); $entityFour->getChildren()->willReturn([]); $collection->contains($entityThree)->willReturn(true); $collection->contains($entityFour)->willReturn(true); $this->transform($collection)->shouldReturn([1 => [$entityThree], 2 => [$entityFour]]); }
/** * Add province * * @param ProvinceInterface $province Province * * @return $this self Object */ public function addProvince(ProvinceInterface $province) { if (!$this->provinces->contains($province)) { $this->provinces->add($province); } return $this; }
/** * Remove requestProductItem * * @param RequestProductItem $requestProductItem * @return RequestProduct */ public function removeRequestProductItem(RequestProductItem $requestProductItem) { if ($this->requestProductItems->contains($requestProductItem)) { $this->requestProductItems->removeElement($requestProductItem); } return $this; }
/** * Add state * * @param StateInterface $state State * * @return $this self Object */ public function addState(StateInterface $state) { if (!$this->states->contains($state)) { $this->states->add($state); } return $this; }
/** * @param Role $role * @return $this */ public function removeRole(Role $role) { if ($this->roles->contains($role)) { $this->roles->removeElement($role); } return $this; }
/** * Add postalCode * * @param PostalCodeInterface $postalCode PostalCode * * @return $this self Object */ public function addPostalCode(PostalCodeInterface $postalCode) { if (!$this->postalCodes->contains($postalCode)) { $this->postalCodes->add($postalCode); } return $this; }
/** * Get the children. * * @param LocationInterface $location Location * * @return $this Self object */ public function addChildren(LocationInterface $location) { if (!$this->children->contains($location)) { $this->children->add($location); } return $this; }
/** * Add Cart Line. * * @param CartLineInterface $cartLine Cart line * * @return $this Self object */ public function addCartLine(CartLineInterface $cartLine) { if (!$this->cartLines->contains($cartLine)) { $this->cartLines->add($cartLine); } return $this; }
/** * Remove categories * * @param \Jbig3Tryings\Crud\Mtm\Entity\Category $categories */ public function removeCategory(Category $category) { if (!$this->categories->contains($category)) { return; } $this->categories->removeElement($category); }
/** * Add Order History * * @param OrderHistoryInterface $orderHistory Order History * * @return $this self Object */ public function addOrderHistory(OrderHistoryInterface $orderHistory) { if (!$this->orderLines->contains($orderHistory)) { $this->orderHistories->add($orderHistory); } return $this; }
public function removeAccount(AccountInterface $account) { if ($this->accounts->contains($account)) { $this->accounts->removeElement($account); $account->removeGroup($this); } }
/** * @param Group $group */ public function removeGroup(Group $group) { if ($this->groups->contains($group)) { $this->groups->removeElement($group); $group->removeAccount($this); } }
/** * @param string $image * * @return $this */ public function addImage($image) { if (!$this->images->contains($image)) { $this->images->add($image); } return $this; }