Remove children.

@param array $children

@return $this
338085
public function removeChildren($children)
    {
        array_splice($this->children, $children[0]->getIndex(), count($children));
        $this->flush();

        return $this;
    }
488727
public function clear(array $keys=null)
    {
        if ($keys === null) {
            $this->_attributes = [];
            return $this;
        }

        if (!$keys) {
            return $this;
        }

        foreach ($keys as $key) {
            if (array_key_exists($key, $this->_attributes)) {
                $this->offsetUnset($key);
            }
        }

        return $this;
    }
1117324
public function clear(array $keys=null)
    {
        $keys = $keys === null ? $this->keys() : $keys;

        foreach ($keys as $key) {
            $this->offsetUnset($key);
        }

        return $this;
    }
1036553
public function removeChildren()
    {
        // we need to collect child nodes to array
        // because removing nodes from the DOMNodeList on iterating is not working
        $childNodes = [];

        foreach ($this->node->childNodes as $childNode) {
            $childNodes[] = $childNode;
        }

        $removedNodes = [];

        foreach ($childNodes as $childNode) {
            $removedNode = $this->node->removeChild($childNode);

            $removedNodes[] = new Element($removedNode);
        }

        return $removedNodes;
    }
320600
public function deleteItems(array $keys)
    {
        foreach ($keys as $key) {
            try {
                $this->delete($key);

            } catch (Exception $e) {}
        }

        return $this;
    }
1246598
public function remove(... $items) : Set
    {
        $values = $this->_removeSameAll($items);
        $this->setValues($values);
        return $this;
    }
1310090
public function deleteWithChildren()
    {
        $ids = array();

        $children = $this->getChildren()->toArray();

        array_walk_recursive($children, function($i, $k) use (&$ids) { if ($k == 'id') $ids[] = $i; });

        foreach ($ids as $id)
        {
            $this->destroy($id);
        }
    }
568668
public function addChildren(array $children, $type = self::TYPE_DEFAULT) {
		foreach ($children as $name => $child) {
			if (is_string($name)) {
				$this->addChild($child, $name, $type);
				continue;
			}
			
			$this->addChild($child, null, $type);
		}
		
		return $this;
	}
1320930
public function removeChild($child)
    {
        $index = $this->resolveChildIndex($child);
        if ($index === false) {
            return $this;
        }

        $node         = $this->children[$index];
        $node->parent = null;

        array_splice($this->children, $index, 1);

        return $this;
    }
312055
public function delete(array $tables = array())
    {
        $this->append(' DELETE ');

        if (!empty($tables)) {
            $tablesSequence = implode(', ', $tables);
            $this->append($tablesSequence);
        }

        return $this;
    }
380059
public function addChild(\Enhavo\Bundle\NavigationBundle\Model\NodeInterface $children)
    {
        $this->children[] = $children;
        $children->setParent($this);

        return $this;
    }
599095
public function excludeTables(array $tables)
    {
        if (is_array($tables) && count($tables) > 0)
        {
            $this->excludedTables = $tables;
        }

        return $this;
    }
811684
public function removeChild($name)
    {
        if (isset($this->children[$name])) {
            unset($this->children[$name]);
        }

        return $this;
    }
512526
public function addChildren(array $children)
    {
        if ($this->exists) {
            \DB::connection($this->connection)->transaction(function () use ($children) {
                $lastChildPosition = $this->getLastChildPosition();

                foreach ($children as $child) {
                    if (!$child instanceof EntityInterface) {
                        if (isset($child['id'])) {
                            unset($child['id']);
                        }

                        $child = new static($child);
                    }

                    $this->addChild($child, $lastChildPosition);
                    $lastChildPosition++;
                }
            });
        }

        return $this;
    }
112191
public function setAddChildrenIfNoneSet($children = array('defaults'))
    {
        if (null === $children) {
            $this->defaultChildren = array('defaults');
        } else {
            $this->defaultChildren = is_int($children) && $children > 0 ? range(1, $children) : (array) $children;
        }
    }
545777
public function removeUsers(ArrayCollection $users)
    {
        foreach ($users as $user) {
            $user->removeTeam($this);
            $this->users->removeElement($user);
        }
    }
1323153
public function appendChildArray(array $children = null)
    {
        if (is_array($children) && !empty($children)) {
            foreach ($children as $child) {
                $this->appendChild($child);
            }
        }
    }