src/Mysql/Query/Delete.php
public function commit($pWithChilds = false)
    {
        try {
            $prepared = Agl::app()->getDb()->getConnection()->prepare("
                DELETE
                FROM
                    `" . $this->getDbPrefix() . $this->_item->getDbContainer() . "`
                WHERE
                    `" . $this->_item->getDbContainer() . ItemInterface::PREFIX_SEPARATOR . ItemInterface::IDFIELD . "` = :" . ItemInterface::IDFIELD . "
            ");

            $preparedValues = array(
                ItemInterface::IDFIELD => $this->_item->getId()->getOrig()
            );

            if (! $prepared->execute($preparedValues)) {
                $error = $prepared->errorInfo();
                throw new Exception("The delete query failed (table '" . $this->getDbPrefix() . $this->_item->getDbContainer() . "') with message '" . $error[2] . "'");
            }

            if ($pWithChilds) {
                $this->_item->removeJoinFromAllChilds();
            }

            if (Agl::app()->isDebugMode()) {
                Agl::app()->getDb()->incrementCounter();
            }

            return $prepared->rowCount();
        } catch (Exception $e) {
            throw new Exception($e);
        }

        return true;
    }
public function commit($pWithChilds = false)
    {
        try {
            $prepared = Agl::app()->getDb()->getConnection()->prepare("
                DELETE
                FROM
                    `" . $this->getDbPrefix() . $this->_item->getDbContainer() . "`
                WHERE
                    `" . $this->_item->getDbContainer() . ItemInterface::PREFIX_SEPARATOR . ItemInterface::IDFIELD . "` = :" . ItemInterface::IDFIELD . "
            ");

            $preparedValues = array(
                ItemInterface::IDFIELD => $this->_item->getId()->getOrig()
            );

            if (! $prepared->execute($preparedValues)) {
                $error = $prepared->errorInfo();
                throw new Exception("The delete query failed (table '" . $this->getDbPrefix() . $this->_item->getDbContainer() . "') with message '" . $error[2] . "'");
            }

            if ($pWithChilds) {
                $this->_item->removeJoinFromAllChilds();
            }

            if (Agl::app()->isDebugMode()) {
                Agl::app()->getDb()->incrementCounter();
            }

            return $prepared->rowCount();
        } catch (Exception $e) {
            throw new Exception($e);
        }

        return true;
    }
public function commit ( $ pWithChilds = false ) { try { $ prepared = Agl :: app ( ) -> getDb ( ) -> getConnection ( ) -> prepare ( "
                DELETE
                FROM
                    `" . $ this -> getDbPrefix ( ) . $ this -> _item -> getDbContainer ( ) . "`
                WHERE
                    `" . $ this -> _item -> getDbContainer ( ) . ItemInterface :: PREFIX_SEPARATOR . ItemInterface :: IDFIELD . "` = :" . ItemInterface :: IDFIELD . "
            " ) ; $ preparedValues = array ( ItemInterface :: IDFIELD => $ this -> _item -> getId ( ) -> getOrig ( ) ) ; if ( ! $ prepared -> execute ( $ preparedValues ) ) { $ error = $ prepared -> errorInfo ( ) ; throw new Exception ( "The delete query failed (table '" . $ this -> getDbPrefix ( ) . $ this -> _item -> getDbContainer ( ) . "') with message '" . $ error [ 2 ] . "'" ) ; } if ( $ pWithChilds ) { $ this -> _item -> removeJoinFromAllChilds ( ) ; } if ( Agl :: app ( ) -> isDebugMode ( ) ) { Agl :: app ( ) -> getDb ( ) -> incrementCounter ( ) ; } return $ prepared -> rowCount ( ) ; } catch ( Exception $ e ) { throw new Exception ( $ e ) ; } return true ; }
Commit the deletion to Mysql and check the query result.

@param bool $pWithChilds Delete also all item's childs in other
collections
@return int Number of affected rows
Commit the deletion to Mysql and check the query result .