Remove childrenEntity

@param Entity $childrenEntity

@return Entity
510349
public function removeChildrenEntity(Entity $childrenEntity)
    {
        foreach ($this->childrenEntities as $key => $childrenEntityElement) {
            if ($childrenEntityElement === $childrenEntity) {
                unset($this->childrenEntities[$key]);
                break;
            }
        }

        return $this;
    }
1099623
public function removeChild(\Amulen\PageBundle\Entity\MenuItem $children)
    {
        $this->children->removeElement($children);
    }
588750
function removeChild($child)
    {
        if (!is_a($child, 'Log') || !isset($this->_children[$child->_id])) {
            return false;
        }

        unset($this->_children[$child->_id]);

        return true;
    }
1232904
public function destroy($resourceId, $childResouceId)
    {
        $this->repository
        ->setResource($resourceId)
        ->setRelation($this->relation())
        ->delete($childResouceId);
        return $this->deletedResponse();
    }
23307
public function removeChildById($id)
	{
		if(isset($this->id2index[$id]))
		{
			$tmp = $this->children[$this->id2index[$id]];
			if(isset($tmp->name))
				unset($this->name2index[$tmp->name]);
			unset($this->children[$this->id2index[$id]], $this->id2index[$id]);
			return $tmp;
		}
		return null;
	}
558707
protected function findAndRemove(EntityInterface $entity = null)
    {
        if (null == $entity) {
            return $entity;
        }

        /** @var EntityInterface $existent */
        foreach ($this->data as $key => $existent) {
            if ($existent->getId() == $entity->getId()) {
                parent::remove($key);
                $this->getEmitter()
                    ->emit(
                        new EntityRemoved(
                            $entity,
                            ['collection' => $this]
                        )
                    );
                break;
            }
        }
        
        return $entity;
    }
306712
protected function removeEntity(EntityInterface $entity)
    {
        Orm::getRepository($this->getEntityClassName())
            ->getIdentityMap()
            ->remove($entity);
    }
381283
public function deleteAccessEntity(AccessEntity $accessEntity)
    {
        try {
            $em = $this->entityManager->getDoctrineEntityManager();
            $em->remove($accessEntity);
            $em->flush();
            
            return true;
        } catch (\Exception $e) {
            throw new Exception('Cannot delete the access entitiy "' . $uuid . '".', 0, $e);
        }
    }
280753
public function detach(Swift_Mime_SimpleMimeEntity $entity)
    {
        $newChildren = [];
        foreach ($this->getChildren() as $child) {
            if ($entity !== $child) {
                $newChildren[] = $child;
            }
        }
        $this->setChildren($newChildren);

        return $this;
    }
477326
public function removeChild(LeafRole $child)
    {
        $this->children->remove($child);
        $child->setParent(null);

        return $this;
    }
181577
public function removeUser(ChildUser $user)
    {
        if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();

            $userRole->setUser($user);
            if ($user->isRolesLoaded()) {
                //remove the back reference if available
                $user->getRoles()->removeObject($this);
            }

            $userRole->setRole($this);
            $this->removeUserRole(clone $userRole);
            $userRole->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;
    }
875259
public function removeEntity(Entity $entity)
    {
        foreach ($this->entities as $key => $entityElement) {
            if ($entityElement === $entity) {
                unset($this->entities[$key]);
                break;
            }
        }

        return $this;
    }
892199
public function deleteEntityByPk($entity, $pk)
    {
        $tbl = $this->resource->getTableName($entity);
        $where = [];
        foreach ($pk as $field => $value) {
            $where["$field=?"] = $value;
        }
        $result = $this->conn->delete($tbl, $where);
        return $result;
    }
1047850
public function removeEntity($entity)
    {
        $registries = $this->findRegistriesEntityById(get_class($entity), $entity->getObjectIdentifier());

        foreach ($registries as $registry) {
            $this->remove($registry);
        }
    }
560591
public function removeReference(ChildReference $reference)
    {
        if ($this->getReferences()->contains($reference)) { $skillReference = new ChildSkillReference();

            $skillReference->setReference($reference);
            if ($reference->isSkillsLoaded()) {
                //remove the back reference if available
                $reference->getSkills()->removeObject($this);
            }

            $skillReference->setSkill($this);
            $this->removeSkillReference(clone $skillReference);
            $skillReference->clear();

            $this->collReferences->remove($this->collReferences->search($reference));

            if (null === $this->referencesScheduledForDeletion) {
                $this->referencesScheduledForDeletion = clone $this->collReferences;
                $this->referencesScheduledForDeletion->clear();
            }

            $this->referencesScheduledForDeletion->push($reference);
        }


        return $this;
    }
1315474
public function remove(AbstractEntity $entity)
    {
        for ($i = count($this->registries) - 1; $i >= 0; $i--) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            $registry->remove($entity->getId());
        }
    }
279156
public function simpleDelete($entity){
        $simpleDelete = new SimpleDelete($entity,$this->getConfig());
        return $this->delete($simpleDelete);
    }