本文整理汇总了PHP中Propel\Runtime\Collection\ObjectCollection::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectCollection::clear方法的具体用法?PHP ObjectCollection::clear怎么用?PHP ObjectCollection::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Runtime\Collection\ObjectCollection
的用法示例。
在下文中一共展示了ObjectCollection::clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removePlayers
/**
* @param ChildPlayers $players The ChildPlayers object to remove.
* @return $this|ChildMlbTeamRef The current object (for fluent API support)
*/
public function removePlayers(ChildPlayers $players)
{
if ($this->getPlayerss()->contains($players)) {
$pos = $this->collPlayerss->search($players);
$this->collPlayerss->remove($pos);
if (null === $this->playerssScheduledForDeletion) {
$this->playerssScheduledForDeletion = clone $this->collPlayerss;
$this->playerssScheduledForDeletion->clear();
}
$this->playerssScheduledForDeletion[] = $players;
$players->setMlbTeamRef(null);
}
return $this;
}
示例2: removeRigAttributeValue
/**
* @param ChildRigAttributeValue $rigAttributeValue The ChildRigAttributeValue object to remove.
* @return $this|ChildRigAttribute The current object (for fluent API support)
*/
public function removeRigAttributeValue(ChildRigAttributeValue $rigAttributeValue)
{
if ($this->getRigAttributeValues()->contains($rigAttributeValue)) {
$pos = $this->collRigAttributeValues->search($rigAttributeValue);
$this->collRigAttributeValues->remove($pos);
if (null === $this->rigAttributeValuesScheduledForDeletion) {
$this->rigAttributeValuesScheduledForDeletion = clone $this->collRigAttributeValues;
$this->rigAttributeValuesScheduledForDeletion->clear();
}
$this->rigAttributeValuesScheduledForDeletion[] = clone $rigAttributeValue;
$rigAttributeValue->setRigAttribute(null);
}
return $this;
}
示例3: removeBook
/**
* @param ChildBook $book The ChildBook object to remove.
* @return $this|ChildPublisher The current object (for fluent API support)
*/
public function removeBook(ChildBook $book)
{
if ($this->getBooks()->contains($book)) {
$pos = $this->collBooks->search($book);
$this->collBooks->remove($pos);
if (null === $this->booksScheduledForDeletion) {
$this->booksScheduledForDeletion = clone $this->collBooks;
$this->booksScheduledForDeletion->clear();
}
$this->booksScheduledForDeletion[] = clone $book;
$book->setPublisher(null);
}
return $this;
}
示例4: removeFitEntry
/**
* @param ChildFitEntry $fitEntry The ChildFitEntry object to remove.
* @return $this|ChildFitEntryType The current object (for fluent API support)
*/
public function removeFitEntry(ChildFitEntry $fitEntry)
{
if ($this->getFitEntries()->contains($fitEntry)) {
$pos = $this->collFitEntries->search($fitEntry);
$this->collFitEntries->remove($pos);
if (null === $this->fitEntriesScheduledForDeletion) {
$this->fitEntriesScheduledForDeletion = clone $this->collFitEntries;
$this->fitEntriesScheduledForDeletion->clear();
}
$this->fitEntriesScheduledForDeletion[] = clone $fitEntry;
$fitEntry->setFitEntryType(null);
}
return $this;
}
示例5: removeLanguage
/**
* @param ChildLanguage $language The ChildLanguage object to remove.
* @return $this|ChildLanguageType The current object (for fluent API support)
*/
public function removeLanguage(ChildLanguage $language)
{
if ($this->getLanguages()->contains($language)) {
$pos = $this->collLanguages->search($language);
$this->collLanguages->remove($pos);
if (null === $this->languagesScheduledForDeletion) {
$this->languagesScheduledForDeletion = clone $this->collLanguages;
$this->languagesScheduledForDeletion->clear();
}
$this->languagesScheduledForDeletion[] = $language;
$language->setType(null);
}
return $this;
}
示例6: removeType
/**
* @param ChildRegionType $type The ChildRegionType object to remove.
* @return $this|ChildRegionArea The current object (for fluent API support)
*/
public function removeType(ChildRegionType $type)
{
if ($this->getTypes()->contains($type)) {
$pos = $this->collTypes->search($type);
$this->collTypes->remove($pos);
if (null === $this->typesScheduledForDeletion) {
$this->typesScheduledForDeletion = clone $this->collTypes;
$this->typesScheduledForDeletion->clear();
}
$this->typesScheduledForDeletion[] = clone $type;
$type->setArea(null);
}
return $this;
}
示例7: removeExpertGroupMembers
/**
* @param ChildExpertGroupMembers $expertGroupMembers The ChildExpertGroupMembers object to remove.
* @return $this|ChildExpertGroup The current object (for fluent API support)
*/
public function removeExpertGroupMembers(ChildExpertGroupMembers $expertGroupMembers)
{
if ($this->getExpertGroupMemberss()->contains($expertGroupMembers)) {
$pos = $this->collExpertGroupMemberss->search($expertGroupMembers);
$this->collExpertGroupMemberss->remove($pos);
if (null === $this->expertGroupMemberssScheduledForDeletion) {
$this->expertGroupMemberssScheduledForDeletion = clone $this->collExpertGroupMemberss;
$this->expertGroupMemberssScheduledForDeletion->clear();
}
$this->expertGroupMemberssScheduledForDeletion[] = clone $expertGroupMembers;
$expertGroupMembers->setExpertGroup(null);
}
return $this;
}
示例8: removeUserAttributeValues
/**
* @param ChildUserAttributeValues $userAttributeValues The ChildUserAttributeValues object to remove.
* @return $this|ChildUserAttributes The current object (for fluent API support)
*/
public function removeUserAttributeValues(ChildUserAttributeValues $userAttributeValues)
{
if ($this->getUserAttributeValuess()->contains($userAttributeValues)) {
$pos = $this->collUserAttributeValuess->search($userAttributeValues);
$this->collUserAttributeValuess->remove($pos);
if (null === $this->userAttributeValuessScheduledForDeletion) {
$this->userAttributeValuessScheduledForDeletion = clone $this->collUserAttributeValuess;
$this->userAttributeValuessScheduledForDeletion->clear();
}
$this->userAttributeValuessScheduledForDeletion[] = clone $userAttributeValues;
$userAttributeValues->setUserAttributes(null);
}
return $this;
}
示例9: removeStock
/**
* @param ChildStock $stock The ChildStock object to remove.
* @return $this|ChildUnit The current object (for fluent API support)
*/
public function removeStock(ChildStock $stock)
{
if ($this->getStocks()->contains($stock)) {
$pos = $this->collStocks->search($stock);
$this->collStocks->remove($pos);
if (null === $this->stocksScheduledForDeletion) {
$this->stocksScheduledForDeletion = clone $this->collStocks;
$this->stocksScheduledForDeletion->clear();
}
$this->stocksScheduledForDeletion[] = $stock;
$stock->setUnit(null);
}
return $this;
}
示例10: removeInvMetaTypes
/**
* @param ChildInvMetaTypes $invMetaTypes The ChildInvMetaTypes object to remove.
* @return $this|ChildInvMetaGroups The current object (for fluent API support)
*/
public function removeInvMetaTypes(ChildInvMetaTypes $invMetaTypes)
{
if ($this->getInvMetaTypess()->contains($invMetaTypes)) {
$pos = $this->collInvMetaTypess->search($invMetaTypes);
$this->collInvMetaTypess->remove($pos);
if (null === $this->invMetaTypessScheduledForDeletion) {
$this->invMetaTypessScheduledForDeletion = clone $this->collInvMetaTypess;
$this->invMetaTypessScheduledForDeletion->clear();
}
$this->invMetaTypessScheduledForDeletion[] = clone $invMetaTypes;
$invMetaTypes->setInvMetaGroups(null);
}
return $this;
}
示例11: removeGroupAccess
/**
* @param ChildGroupAccess $groupAccess The ChildGroupAccess object to remove.
* @return $this|ChildEntityType The current object (for fluent API support)
*/
public function removeGroupAccess(ChildGroupAccess $groupAccess)
{
if ($this->getGroupAccesses()->contains($groupAccess)) {
$pos = $this->collGroupAccesses->search($groupAccess);
$this->collGroupAccesses->remove($pos);
if (null === $this->groupAccessesScheduledForDeletion) {
$this->groupAccessesScheduledForDeletion = clone $this->collGroupAccesses;
$this->groupAccessesScheduledForDeletion->clear();
}
$this->groupAccessesScheduledForDeletion[] = clone $groupAccess;
$groupAccess->setEntityType(null);
}
return $this;
}
示例12: removeTeams
/**
* @param ChildTeams $teams The ChildTeams object to remove.
* @return $this|ChildLeagueRef The current object (for fluent API support)
*/
public function removeTeams(ChildTeams $teams)
{
if ($this->getTeamss()->contains($teams)) {
$pos = $this->collTeamss->search($teams);
$this->collTeamss->remove($pos);
if (null === $this->teamssScheduledForDeletion) {
$this->teamssScheduledForDeletion = clone $this->collTeamss;
$this->teamssScheduledForDeletion->clear();
}
$this->teamssScheduledForDeletion[] = $teams;
$teams->setLeagueRef(null);
}
return $this;
}
示例13: removeApplication
/**
* @param ChildApplication $application The ChildApplication object to remove.
* @return $this|ChildStudent The current object (for fluent API support)
*/
public function removeApplication(ChildApplication $application)
{
if ($this->getApplications()->contains($application)) {
$pos = $this->collApplications->search($application);
$this->collApplications->remove($pos);
if (null === $this->applicationsScheduledForDeletion) {
$this->applicationsScheduledForDeletion = clone $this->collApplications;
$this->applicationsScheduledForDeletion->clear();
}
$this->applicationsScheduledForDeletion[] = clone $application;
$application->setStudent(null);
}
return $this;
}
示例14: removeRole
/**
* Remove role of this object
* through the user_role cross reference table.
*
* @param ChildRole $role
* @return ChildUser The current object (for fluent API support)
*/
public function removeRole(ChildRole $role)
{
if ($this->getRoles()->contains($role)) {
$userRole = new ChildUserRole();
$userRole->setRole($role);
if ($role->isUsersLoaded()) {
//remove the back reference if available
$role->getUsers()->removeObject($this);
}
$userRole->setUser($this);
$this->removeUserRole(clone $userRole);
$userRole->clear();
$this->collRoles->remove($this->collRoles->search($role));
if (null === $this->rolesScheduledForDeletion) {
$this->rolesScheduledForDeletion = clone $this->collRoles;
$this->rolesScheduledForDeletion->clear();
}
$this->rolesScheduledForDeletion->push($role);
}
return $this;
}
示例15: removeUser
/**
* Remove user of this object
* through the user_group cross reference table.
*
* @param ChildUser $user
* @return ChildGroup The current object (for fluent API support)
*/
public function removeUser(ChildUser $user)
{
if ($this->getUsers()->contains($user)) {
$userGroup = new ChildUserGroup();
$userGroup->setUser($user);
if ($user->isGroupsLoaded()) {
//remove the back reference if available
$user->getGroups()->removeObject($this);
}
$userGroup->setGroup($this);
$this->removeUserGroup(clone $userGroup);
$userGroup->clear();
$this->collUsers->remove($this->collUsers->search($user));
if (null === $this->usersScheduledForDeletion) {
$this->usersScheduledForDeletion = clone $this->collUsers;
$this->usersScheduledForDeletion->clear();
}
$this->usersScheduledForDeletion->push($user);
}
return $this;
}