Esempio n. 1
0
 /**
  * Remove articles
  *
  * @param Article $article
  */
 public function removeArticle(Article $article)
 {
     if ($this->articles->contains($article)) {
         $this->articles->removeElement($article);
         $article->removeCitation($this);
     }
 }
Esempio n. 2
0
 /**
  * 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);
     }
 }
Esempio n. 3
0
 /**
  * @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);
 }
Esempio n. 4
0
 /**
  * @param Archivo $archivo
  */
 public function removeArchivo($archivo)
 {
     if ($this->archivos->contains($archivo)) {
         $this->archivos->removeElement($archivo);
         $archivo->setDocumentable(null);
     }
 }
Esempio n. 5
0
 /**
  * @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);
 }
Esempio n. 7
0
 /**
  * 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);
         }
     });
 }
Esempio n. 10
0
 /**
  * {@inheritdoc}
  */
 public function save(TaskInterface $task)
 {
     if ($this->taskCollection->contains($task)) {
         return $this;
     }
     $this->taskCollection->add($task);
     return $this;
 }
Esempio n. 11
0
 /**
  * @param Scene $scene
  *
  * @return Chapter
  */
 public function addScene(Scene $scene)
 {
     if (!$this->scenes->contains($scene)) {
         $scene->setChapter($this);
         $this->scenes->add($scene);
     }
     return $this;
 }
Esempio n. 12
0
 /**
  * @param User $user
  */
 public function removeUser(User $user)
 {
     if (!$this->users->contains($user)) {
         return;
     }
     $this->users->removeElement($user);
     $user->removeGroup($this);
 }
Esempio n. 13
0
 /**
  * @param Chapter $chapter
  *
  * @return Book
  */
 public function addChapter(Chapter $chapter)
 {
     if (!$this->chapters->contains($chapter)) {
         $this->chapters->add($chapter);
         $chapter->setBook($this);
     }
     return $this;
 }
Esempio n. 14
0
 /**
  * @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;
 }
Esempio n. 15
0
 /**
  * @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)));
 }
Esempio n. 17
0
 /**
  * {@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]]);
 }
Esempio n. 19
0
 /**
  * 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;
 }
Esempio n. 20
0
 /**
  * Remove requestProductItem
  *
  * @param RequestProductItem $requestProductItem
  * @return RequestProduct
  */
 public function removeRequestProductItem(RequestProductItem $requestProductItem)
 {
     if ($this->requestProductItems->contains($requestProductItem)) {
         $this->requestProductItems->removeElement($requestProductItem);
     }
     return $this;
 }
Esempio n. 21
0
 /**
  * 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;
 }
Esempio n. 22
0
 /**
  * @param Role $role
  * @return $this
  */
 public function removeRole(Role $role)
 {
     if ($this->roles->contains($role)) {
         $this->roles->removeElement($role);
     }
     return $this;
 }
Esempio n. 23
0
 /**
  * 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;
 }
Esempio n. 24
0
 /**
  * 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;
 }
Esempio n. 25
0
 /**
  * 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;
 }
Esempio n. 26
0
 /**
  * Remove categories
  *
  * @param \Jbig3Tryings\Crud\Mtm\Entity\Category $categories
  */
 public function removeCategory(Category $category)
 {
     if (!$this->categories->contains($category)) {
         return;
     }
     $this->categories->removeElement($category);
 }
Esempio n. 27
0
 /**
  * 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;
 }
Esempio n. 28
0
 public function removeAccount(AccountInterface $account)
 {
     if ($this->accounts->contains($account)) {
         $this->accounts->removeElement($account);
         $account->removeGroup($this);
     }
 }
Esempio n. 29
0
 /**
  * @param Group $group
  */
 public function removeGroup(Group $group)
 {
     if ($this->groups->contains($group)) {
         $this->groups->removeElement($group);
         $group->removeAccount($this);
     }
 }
Esempio n. 30
0
 /**
  * @param string $image
  *
  * @return $this
  */
 public function addImage($image)
 {
     if (!$this->images->contains($image)) {
         $this->images->add($image);
     }
     return $this;
 }