public function delete($table, $where)
    {
        $context = $this->getCommandContext();
        $context->table    = $table;
        $context->data    = null;
        $context->where    = $where;
        $context->operation    = AnDatabase::OPERATION_DELETE;

        //Excute the delete operation
        if ($this->getCommandChain()->run('before.delete', $context) !== false) {
            //Create query statement
            $context->query = 'DELETE FROM '.$this->quoteName($this->getTableNeedle().$context->table)
                  .' '.$context->where
            ;

            //Execute the query
            $context->result = $this->execute($context->query);

            $context->affected = $this->_affected_rows;
            $this->getCommandChain()->run('after.delete', $context);
        }

        return $context->affected;
    }
public function delete($table, $where)
    {
        $context = $this->getCommandContext();
        $context->table    = $table;
        $context->data    = null;
        $context->where    = $where;
        $context->operation    = AnDatabase::OPERATION_DELETE;

        //Excute the delete operation
        if ($this->getCommandChain()->run('before.delete', $context) !== false) {
            //Create query statement
            $context->query = 'DELETE FROM '.$this->quoteName($this->getTableNeedle().$context->table)
                  .' '.$context->where
            ;

            //Execute the query
            $context->result = $this->execute($context->query);

            $context->affected = $this->_affected_rows;
            $this->getCommandChain()->run('after.delete', $context);
        }

        return $context->affected;
    }
public function delete ( $ table , $ where ) { $ context = $ this -> getCommandContext ( ) ; $ context -> table = $ table ; $ context -> data = null ; $ context -> where = $ where ; $ context -> operation = AnDatabase :: OPERATION_DELETE ; //Excute the delete operation if ( $ this -> getCommandChain ( ) -> run ( 'before.delete' , $ context ) !== false ) { //Create query statement $ context -> query = 'DELETE FROM ' . $ this -> quoteName ( $ this -> getTableNeedle ( ) . $ context -> table ) . ' ' . $ context -> where ; //Execute the query $ context -> result = $ this -> execute ( $ context -> query ) ; $ context -> affected = $ this -> _affected_rows ; $ this -> getCommandChain ( ) -> run ( 'after.delete' , $ context ) ; } return $ context -> affected ; }
Deletes rows from the table based on a WHERE clause.

@param string 	The table to update
@param mixed  	A query string or a AnDatabaseQuery object to limit which rows are updated.
@return integer 	Number of rows affected, or -1 if an error occured.
Deletes rows from the table based on a WHERE clause .