public function delete($query)
    {
        $resources = $query->getRepository()->getResources();

        foreach ($resources->getLinks() as $link) {
            $query->where($link->child, '=', $link->parent);
        }

        $names = array();

        foreach ($resources as $resource) {
            $query->from($resource->getName().' AS '.$this->_store->quoteName($resource->getAlias()));
            $names[] = $this->_store->quoteName($resource->getAlias());
        }

        $clause = 'DELETE '.implode(', ', $names);

        return $clause;
    }
public function delete($query)
    {
        $resources = $query->getRepository()->getResources();

        foreach ($resources->getLinks() as $link) {
            $query->where($link->child, '=', $link->parent);
        }

        $names = array();

        foreach ($resources as $resource) {
            $query->from($resource->getName().' AS '.$this->_store->quoteName($resource->getAlias()));
            $names[] = $this->_store->quoteName($resource->getAlias());
        }

        $clause = 'DELETE '.implode(', ', $names);

        return $clause;
    }
public function delete ( $ query ) { $ resources = $ query -> getRepository ( ) -> getResources ( ) ; foreach ( $ resources -> getLinks ( ) as $ link ) { $ query -> where ( $ link -> child , '=' , $ link -> parent ) ; } $ names = array ( ) ; foreach ( $ resources as $ resource ) { $ query -> from ( $ resource -> getName ( ) . ' AS ' . $ this -> _store -> quoteName ( $ resource -> getAlias ( ) ) ) ; $ names [ ] = $ this -> _store -> quoteName ( $ resource -> getAlias ( ) ) ; } $ clause = 'DELETE ' . implode ( ', ' , $ names ) ; return $ clause ; }
Builds an delete query. Handles multiple resources at once.

@param AnDomainQuery $query Query object

@return string
Builds an delete query . Handles multiple resources at once .