removeElement() public method

{@inheritDoc}
public removeElement ( $element )
 /**
  * @param Deputy $deputy
  * @return HasDeputiesInterface
  */
 public function removeDeputy(Deputy $deputy)
 {
     if (true === $this->hasDeputy($deputy)) {
         $this->deputies->removeElement($deputy);
     }
     return $this;
 }
Example #2
0
 /**
  * @return $this
  */
 public function removeParcelResponse(ParcelResponse $parcelResponse)
 {
     if ($this->parcelResponses->contains($parcelResponse)) {
         $this->parcelResponses->removeElement($parcelResponse);
     }
     return $this;
 }
 /**
  * @param \Opg\Core\Model\Entity\LineItem\LineItem $closingBalance
  * @return HasClosingBalances
  */
 public function removeClosingBalance(LineItem $closingBalance)
 {
     if ($this->closingBalanceExists($closingBalance)) {
         $this->closingBalances->removeElement($closingBalance);
     }
     return $this;
 }
 /**
  * @param LineItem $asset
  * @return HasAssetLog
  */
 public function removeAsset(LineItem $asset)
 {
     if ($this->assetExists($asset)) {
         $this->assets->removeElement($asset);
     }
     return $this;
 }
 /**
  * @inheritdoc
  */
 public function remove(User $user)
 {
     if (!$this->collection->containsKey((string) $user->getId())) {
         throw new UserNotFoundException();
     }
     return $this->collection->removeElement($user);
 }
 /**
  * @param CourtFund $fund
  * @return HasCourtFundsInterface
  */
 public function removeCourtFund(CourtFund $fund)
 {
     if ($this->hasCourtFund($fund)) {
         $this->courtFunds->removeElement($fund);
     }
     return $this;
 }
Example #7
0
 public function removePost(Post $post)
 {
     if ($this->posts->contains($post)) {
         $this->posts->removeElement($post);
     }
     return $this;
 }
 /**
  * @param Fees $fee
  * @return HasFeesInterface
  */
 public function removeFee(Fees $fee)
 {
     if (true === $this->hasFee($fee)) {
         $this->fees->removeElement($fee);
     }
     return $this;
 }
Example #9
0
 public function removePost(Post $post)
 {
     if (!$this->hasPost($post)) {
         throw new DomainException('Post is not exists');
     }
     $this->posts->removeElement($post);
 }
Example #10
0
 /**
  * @param UndoableCommandInterface $cmd
  */
 public function undo(UndoableCommandInterface $cmd)
 {
     if ($this->history->removeElement($cmd) === false) {
         throw new CommandDispatcherException('Command is not executed, nothing to undo.');
     }
     $cmd->undo();
 }
Example #11
0
 /**
  * @param FolderUser $user
  * @return $this
  */
 public function removeUser(FolderUser $user)
 {
     if ($this->hasUser($user)) {
         $this->Users->removeElement($user);
     }
     return $this;
 }
 /**
  * @param Category $category
  * @param bool $stopPropagation
  * @return $this
  */
 public function removeCategory(Category $category, $stopPropagation = false)
 {
     $this->categories->removeElement($category);
     if (!$stopPropagation) {
         $category->removeDocument($this, true);
     }
     return $this;
 }
Example #13
0
 public function removePermission($permission)
 {
     if (null === $permission || false === is_string($permission)) {
         trigger_error("removePermission expected Argument to be a string not null", E_USER_ERROR);
     }
     $this->permissions->removeElement($permission);
     return $this;
 }
Example #14
0
 /**
  * Remove a lesson from the section.
  *
  * @param Section $section
  *
  * @return $this
  */
 public function removeSection(Section $section)
 {
     if ($this->sections->contains($section)) {
         $this->sections->removeElement($section);
         $section->setLesson(null);
     }
     return $this;
 }
Example #15
0
 /**
  * @param User $user
  * @return bool
  */
 public function removeUser(User $user)
 {
     if ($this->hasUser($user)) {
         $this->Users->removeElement($user);
         return true;
     }
     return false;
 }
 /**
  * @param CaseItem $caseItem
  * @return HasCasesInterface
  */
 public function removeCase(CaseItem $caseItem)
 {
     $this->initCases();
     if (true == $this->cases->contains($caseItem)) {
         $this->cases->removeElement($caseItem);
     }
     return $this;
 }
Example #17
0
 /**
  * @param UserInterface $user
  *
  * @return RoleInterface
  */
 public function removeUser(UserInterface $user)
 {
     $this->users->removeElement($user);
     if ($user->hasRole($this) === true) {
         $user->removeRole($this);
     }
     return $this;
 }
 /**
  * @param AttorneyAbstract $attorney
  * @return HasAttorneys
  */
 public function removeAttorney(AttorneyAbstract $attorney)
 {
     $this->initAttorneys();
     if ($this->attorneyExists($attorney)) {
         $this->attorneys->removeElement($attorney);
     }
     return $this;
 }
Example #19
0
 /**
  * {@inheritdoc}
  */
 public function removeWidget(AttributeWidget $widget)
 {
     if ($this->hasWidget($widget)) {
         $this->widgets->removeElement($widget);
         $widget->getArchetype()->removeAttribute($widget->getAttribute());
         $widget->setArchetype(null);
     }
     return $this;
 }
Example #20
0
 /**
  * Remove a workflow instance
  *
  * @param  WorkflowInstanceEntity $workflowInstance Instance entity to remove
  *
  * @return self
  */
 public function removeWorkflowInstance(WorkflowInstanceEntity $workflowInstance)
 {
     // Check if workflow instances is initialized
     if (null === $this->workflowInstances) {
         $this->workflowInstances = new ArrayCollection();
     }
     $this->workflowInstances->removeElement($workflowInstance);
     return $this;
 }
Example #21
0
 /**
  * {@inheritdoc}
  */
 public function removeProduct(Product $product)
 {
     if ($this->hasProduct($product)) {
         $this->products->removeElement($product);
         $product->setStore(null);
     }
 }
Example #22
0
 public function removeMedia(Media $media)
 {
     if ($this->medias->contains($media)) {
         $this->medias->removeElement($media);
     }
     return $this;
 }
Example #23
0
 function removeComments(Comment $comments)
 {
     if ($this->comments->contains($comments)) {
         $this->comments->removeElement($comments);
     }
     return $this;
 }
Example #24
0
 /**
  * Remove game
  * 
  * @param EGGame $game
  * @return EGGame
  */
 public function removeGame(EGGame $game)
 {
     if ($this->games->contains($game)) {
         $this->games->removeElement($game);
     }
     return $this;
 }
Example #25
0
 /**
  * @param EmailFolder $folder
  *
  * @return $this
  */
 public function removeSubFolder(EmailFolder $folder)
 {
     if ($this->subFolders->contains($folder)) {
         $this->subFolders->removeElement($folder);
     }
     return $this;
 }
Example #26
0
 /**
  * {@inheritDoc}
  */
 public function removeAlias(DocumentInterface $document)
 {
     if ($this->aliases->contains($document)) {
         $this->aliases->removeElement($document);
     }
     return $this;
 }
Example #27
0
 /**
  * Removes a given variability option
  *
  * @param OptionInterface $variabilityOption
  *
  * @return $this
  */
 public function removeVariabilityOption(OptionInterface $variabilityOption)
 {
     if ($this->hasVariabilityOption($variabilityOption)) {
         $this->variabilityOptions->removeElement($variabilityOption);
     }
     return $this;
 }
 public function removeObject($class, $removeAttrs = [])
 {
     foreach ($removeAttrs as $attr) {
         $this->attributes[$attr]->set(null);
     }
     $this->objects->removeElement($this->getObject($class));
 }
Example #29
0
 /**
  * @param FlatModel $flat
  */
 public function removeExcludedFlat(FlatModel $flat)
 {
     if (!$this->excludedFlats->contains($flat)) {
         return;
     }
     $this->excludedFlats->removeElement($flat);
 }
Example #30
0
 /**
  * @param Blog $blog
  *
  * @return Event
  */
 public function removeBlog(Blog $blog)
 {
     if ($this->blogs->contains($blog)) {
         $this->blogs->removeElement($blog);
     }
     return $this;
 }