本文整理汇总了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;
}
示例2: removeParcelResponse
/**
* @return $this
*/
public function removeParcelResponse(ParcelResponse $parcelResponse)
{
if ($this->parcelResponses->contains($parcelResponse)) {
$this->parcelResponses->removeElement($parcelResponse);
}
return $this;
}
示例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;
}
示例4: removeAsset
/**
* @param LineItem $asset
* @return HasAssetLog
*/
public function removeAsset(LineItem $asset)
{
if ($this->assetExists($asset)) {
$this->assets->removeElement($asset);
}
return $this;
}
示例5: remove
/**
* @inheritdoc
*/
public function remove(User $user)
{
if (!$this->collection->containsKey((string) $user->getId())) {
throw new UserNotFoundException();
}
return $this->collection->removeElement($user);
}
示例6: removeCourtFund
/**
* @param CourtFund $fund
* @return HasCourtFundsInterface
*/
public function removeCourtFund(CourtFund $fund)
{
if ($this->hasCourtFund($fund)) {
$this->courtFunds->removeElement($fund);
}
return $this;
}
示例7: removePost
public function removePost(Post $post)
{
if ($this->posts->contains($post)) {
$this->posts->removeElement($post);
}
return $this;
}
示例8: removeFee
/**
* @param Fees $fee
* @return HasFeesInterface
*/
public function removeFee(Fees $fee)
{
if (true === $this->hasFee($fee)) {
$this->fees->removeElement($fee);
}
return $this;
}
示例9: removePost
public function removePost(Post $post)
{
if (!$this->hasPost($post)) {
throw new DomainException('Post is not exists');
}
$this->posts->removeElement($post);
}
示例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();
}
示例11: removeUser
/**
* @param FolderUser $user
* @return $this
*/
public function removeUser(FolderUser $user)
{
if ($this->hasUser($user)) {
$this->Users->removeElement($user);
}
return $this;
}
示例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;
}
示例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;
}
示例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;
}
示例15: removeUser
/**
* @param User $user
* @return bool
*/
public function removeUser(User $user)
{
if ($this->hasUser($user)) {
$this->Users->removeElement($user);
return true;
}
return false;
}