當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArrayCollection::removeElement方法代碼示例

本文整理匯總了PHP中Doctrine\Common\Collections\ArrayCollection::removeElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayCollection::removeElement方法的具體用法?PHP ArrayCollection::removeElement怎麽用?PHP ArrayCollection::removeElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\Common\Collections\ArrayCollection的用法示例。


在下文中一共展示了ArrayCollection::removeElement方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeDeputy

 /**
  * @param Deputy $deputy
  * @return HasDeputiesInterface
  */
 public function removeDeputy(Deputy $deputy)
 {
     if (true === $this->hasDeputy($deputy)) {
         $this->deputies->removeElement($deputy);
     }
     return $this;
 }
開發者ID:ministryofjustice,項目名稱:opg-core-public-domain-model,代碼行數:11,代碼來源:HasDeputies.php

示例2: removeParcelResponse

 /**
  * @return $this
  */
 public function removeParcelResponse(ParcelResponse $parcelResponse)
 {
     if ($this->parcelResponses->contains($parcelResponse)) {
         $this->parcelResponses->removeElement($parcelResponse);
     }
     return $this;
 }
開發者ID:winzou,項目名稱:tnt-express,代碼行數:10,代碼來源:Expedition.php

示例3: removeClosingBalance

 /**
  * @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;
 }
開發者ID:ministryofjustice,項目名稱:opg-core-public-domain-model,代碼行數:11,代碼來源:ClosingBalances.php

示例4: removeAsset

 /**
  * @param LineItem $asset
  * @return HasAssetLog
  */
 public function removeAsset(LineItem $asset)
 {
     if ($this->assetExists($asset)) {
         $this->assets->removeElement($asset);
     }
     return $this;
 }
開發者ID:ministryofjustice,項目名稱:opg-core-public-domain-model,代碼行數:11,代碼來源:AssetLog.php

示例5: remove

 /**
  * @inheritdoc
  */
 public function remove(User $user)
 {
     if (!$this->collection->containsKey((string) $user->getId())) {
         throw new UserNotFoundException();
     }
     return $this->collection->removeElement($user);
 }
開發者ID:xtreamwayz,項目名稱:zend-expressive-app-poc,代碼行數:10,代碼來源:InMemoryUserRepository.php

示例6: removeCourtFund

 /**
  * @param CourtFund $fund
  * @return HasCourtFundsInterface
  */
 public function removeCourtFund(CourtFund $fund)
 {
     if ($this->hasCourtFund($fund)) {
         $this->courtFunds->removeElement($fund);
     }
     return $this;
 }
開發者ID:ministryofjustice,項目名稱:opg-core-public-domain-model,代碼行數:11,代碼來源:HasCourtFunds.php

示例7: removePost

 public function removePost(Post $post)
 {
     if ($this->posts->contains($post)) {
         $this->posts->removeElement($post);
     }
     return $this;
 }
開發者ID:artoodetoo,項目名稱:BlogMVC,代碼行數:7,代碼來源:User.php

示例8: removeFee

 /**
  * @param Fees $fee
  * @return HasFeesInterface
  */
 public function removeFee(Fees $fee)
 {
     if (true === $this->hasFee($fee)) {
         $this->fees->removeElement($fee);
     }
     return $this;
 }
開發者ID:ministryofjustice,項目名稱:opg-core-public-domain-model,代碼行數:11,代碼來源:HasFees.php

示例9: removePost

 public function removePost(Post $post)
 {
     if (!$this->hasPost($post)) {
         throw new DomainException('Post is not exists');
     }
     $this->posts->removeElement($post);
 }
開發者ID:nebuchar,項目名稱:ddd-blog,代碼行數:7,代碼來源:User.php

示例10: undo

 /**
  * @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();
 }
開發者ID:stiggg,項目名稱:command-dispatcher,代碼行數:10,代碼來源:Dispatcher.php

示例11: removeUser

 /**
  * @param FolderUser $user
  * @return $this
  */
 public function removeUser(FolderUser $user)
 {
     if ($this->hasUser($user)) {
         $this->Users->removeElement($user);
     }
     return $this;
 }
開發者ID:ChrisWesterfield,項目名稱:MJR.ONE-CP,代碼行數:11,代碼來源:Folder.php

示例12: removeCategory

 /**
  * @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;
 }
開發者ID:saxulum,項目名稱:saxulum-doctrine-mongodb-odm-manager-registry-provider,代碼行數:13,代碼來源:Document.php

示例13: removePermission

 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;
 }
開發者ID:bface007,項目名稱:esgis_gabon,代碼行數:8,代碼來源:Module.php

示例14: removeSection

 /**
  * 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;
 }
開發者ID:Elorfin,項目名稱:MusicTools,代碼行數:15,代碼來源:Lesson.php

示例15: removeUser

 /**
  * @param User $user
  * @return bool
  */
 public function removeUser(User $user)
 {
     if ($this->hasUser($user)) {
         $this->Users->removeElement($user);
         return true;
     }
     return false;
 }
開發者ID:ChrisWesterfield,項目名稱:MJR.ONE-CP,代碼行數:12,代碼來源:Group.php


注:本文中的Doctrine\Common\Collections\ArrayCollection::removeElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。