Delete the non existing

@param CanHaveParent[] $dbChildren

@return array
163453
protected function removeDeletedFsChildrenFromDb($dbChildren)
    {
        $existingChildren = [];

        // First delete all children that do not exist in fs
        foreach ($dbChildren as $child) {

            if (!$this->filesystem->exists($child->getPath())) {
                $this->nodeRepository->delete($child);
                continue;
            }
            $existingChildren[] = $child;
        }

        return $existingChildren;
    }
1201533
protected function createDeletedVersion($stages = [])
    {
        // Skip if suppressed by parent delete
        if (!$this->getDeleteWritesVersion()) {
            return;
        }
        // Prepare manipulation
        $baseTable = $this->owner->baseTable();
        $now = DBDatetime::now()->Rfc2822();
        // Ensure all fixed_fields are specified
        $manipulation = [
            $baseTable => [
                'fields' => [
                    'ID' => $this->owner->ID,
                    'LastEdited' => $now,
                    'Created' => $this->owner->Created ?: $now,
                    'ClassName' => $this->owner->ClassName,
                ],
            ],
        ];
        // Prepare "deleted" augment write
        $this->augmentWriteVersioned(
            $manipulation,
            $this->owner->baseClass(),
            $baseTable,
            $this->owner->ID,
            $stages,
            true
        );
        unset($manipulation[$baseTable]);
        $this->owner->extend('augmentWriteDeletedVersion', $manipulation, $stages);
        DB::manipulate($manipulation);
    }
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;
    }
179684
public function delete(AbstractNestedNode $node)
    {
        if (true === $node->isRoot()) {
            return false;
        }

        $this->createQueryBuilder('n')
                ->set('n._parent', 'NULL')
                ->andIsDescendantOf($node)
                ->update()
                ->getQuery()
                ->execute();

        $this->createQueryBuilder('n')
                ->delete()
                ->andIsDescendantOf($node)
                ->getQuery()
                ->execute();

        $this->shiftRlValues($node->getParent(), $node->getLeftnode(), -$node->getWeight());

        return true;
    }
279854
public function getChildren()
    {
        if ($this->disableListing) {
            throw new DAV\Exception\MethodNotAllowed('Listing members of this collection is disabled');
        }
        $children = [];
        foreach ($this->principalBackend->getPrincipalsByPrefix($this->principalPrefix) as $principalInfo) {
            $children[] = $this->getChildForPrincipal($principalInfo);
        }

        return $children;
    }
200062
public function delete(array $keys, $db = -1)
    {
        if(-1 != $db) {
            $this->execute('select', array($db));
        }

        return $this->execute('del', $keys);
    }
803051
public function delete( $structureOrPrimaryKeys )
    {
        if ( is_object( $structureOrPrimaryKeys ) )
        {
            $section = $structureOrPrimaryKeys->section;
        }
        else if ( is_array( $structureOrPrimaryKeys ) )
        {
            $section = $structureOrPrimaryKeys['section'];
        }
        else
        {
            $section = (string) $structureOrPrimaryKeys;
        }

        $rows = 0;
        $def  = $this->getDefinitions();
        $keys = $def->getKeys( $section );

        if ( ! empty( $keys ) )
        {
            $delete = $this->sql()
                           ->delete()
                           ->where( $this->keysWhere( $keys ) );

            $result = $this->sql()
                           ->prepareStatementForSqlObject( $delete )
                           ->execute();

            $rows += $result->getAffectedRows();
        }

        $fieldsets = $def->getFieldsets( $section );

        if ( ! empty( $fieldsets ) )
        {
            foreach ( $fieldsets as $fieldset )
            {
                $rows += $this->delete( $fieldset );
            }
        }

        return $rows;
    }
708764
public function delete($pWithChilds = false)
    {
        Observer::dispatch(Observer::EVENT_ITEM_DELETE_BEFORE, array(
            'item' => $this
        ));

        $delete = new Delete($this);
        $delete->commit($pWithChilds);

        Observer::dispatch(Observer::EVENT_ITEM_DELETE_AFTER, array(
            'item' => $this
        ));

        return $this;
    }
979527
public function callHasChildren()
    {
        $result = false;

        if($this->current()->isRecursable()) {
            $result = $this->current()->hasChildren();
        }

        return $result;
    }
779523
public function deleteTbl($dbname, $table)
    {
        $this->db->exec($this->query->useQuery($dbname));
        $sql = $this->query->deleteTbl($table);
        $this->db->exec($sql);

        return true;
    }
163230
protected function getChildrenList() {
        $query = (new Query)->from($this->itemChildTable);
        $parents = [];
        foreach ($query->all($this->db) as $row) {
            $parents[$row['parent']][] = $row['child'];
        }
        return $parents;
    }
856570
public function delete(Node\NodeInterface $node)
	{
		if ( ! $this->locked) {
			//\Log::info('Should lock before changes');
		}

		if ( ! $node instanceof Node\DoctrineNode) {
			throw new Exception\WrongInstance($node, 'Node\DoctrineNode');
		}
		
		$left = $node->getLeftValue();
		$right = $node->getRightValue();

		// Deletes only children here because there could be associations that 
		// doesn't allow deletion, then only leafs could be erased
		$sql = "DELETE FROM {$this->tableName}
				WHERE lft > {$left} AND rgt < {$right}";

		$sql .= $this->getAdditionalConditionSql('AND');

		$this->entityManager->getConnection()
				->exec($sql);
		
//		// Deletes only children here because there could be associations that
//		// doesn't allow deletion, then only leafs could be erased
//		$dql = "DELETE FROM {$this->className} e
//				WHERE e.left > {$left} AND e.right < {$right}";
//
//		$dql .= $this->getAdditionalCondition('AND');
//
//		$query = $this->entityManager->createQuery($dql);
//		$query->execute();
		
		$this->arrayHelper->delete($node);
	}
1072279
private function removeElements( $elements ) {
		$list = $elements;
		if ( $elements instanceof \DOMNodeList ) {
			$list = [];
			foreach ( $elements as $element ) {
				$list[] = $element;
			}
		}
		/** @var $element \DOMElement */
		foreach ( $list as $element ) {
			if ( $element->parentNode ) {
				$element->parentNode->removeChild( $element );
			}
		}
		return $list;
	}
1034018
public function deleteDatabase($domainName, $db)
    {
        return $this->getSoapClient(array_merge(array($domainName, $db), array('__method' => 'deleteDatabase')))->deleteDatabase($domainName, $db);
    }
520433
public function doAllChildrenIncludingDeleted($context=null) {
        if(!$this->owner) user_error('Hierarchy::doAllChildrenIncludingDeleted() called without $this->owner');
    
        $idxStageChildren=array();
        $idxLiveChildren=array();
    
        $baseClass=ClassInfo::baseDataClass($this->owner->class);
        if($baseClass) {
            $stageChildren=$this->owner->stageChildren(true);
    
            $this->owner->extend("augmentAllChildrenIncludingDeleted", $stageChildren, $context);
                
        }else {
            user_error("SnippetHierarchy::AllChildren() Couldn't determine base class for '{$this->owner->class}'", E_USER_ERROR);
        }
    
        return $stageChildren;
    }
937274
function Delete($childName, $childIndex = 0)
    {
        //Delete all of the children of that child
        $this->{$childName}[$childIndex]->DeleteChildren();
        
        //Destroy the child's value
        $this->{$childName}[$childIndex] = null;
        
        //Remove the child's name from the named array
        unset($this->{$childName}[$childIndex]);
        
        //Loop through the tagChildren array and remove any null
        //values left behind from the above operation
        for($x = 0; $x < count($this->tagChildren); $x ++)
        {
            if(is_null($this->tagChildren[$x]))
                unset($this->tagChildren[$x]);
        }
    }
742160
def delete_children(attribute)
      self.send(attribute).each { |c| c.parent = nil }
      self.send(attribute).clear
    end