src/Gossamer/Pesedget/Commands/DeleteCommand.php
public function execute($params = array(), $requestParams = array()){
      
        $deleteParams = $params;
        if(count($requestParams) > 0) {
            $deleteParams = $requestParams;
        }
        $this->beginTransaction();
        $firstResult = null;
        try{
            //first delete the child tables
            $this->deleteI18nLocales($deleteParams); 
            $this->deleteOneToOneRows($deleteParams);

            //now delete the main tables
            $this->getQueryBuilder()->where($deleteParams);
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::DELETE_QUERY);

            $firstResult = $this->query($query);

            $this->commitTransaction();
        }catch(Exception $e){
            $this->logger->addError($e->getMessage());
            $this->rollbackTransaction();
        }
        return $firstResult;

    }
public function execute($params = array(), $requestParams = array()){
      
        $deleteParams = $params;
        if(count($requestParams) > 0) {
            $deleteParams = $requestParams;
        }
        $this->beginTransaction();
        $firstResult = null;
        try{
            //first delete the child tables
            $this->deleteI18nLocales($deleteParams); 
            $this->deleteOneToOneRows($deleteParams);

            //now delete the main tables
            $this->getQueryBuilder()->where($deleteParams);
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::DELETE_QUERY);

            $firstResult = $this->query($query);

            $this->commitTransaction();
        }catch(Exception $e){
            $this->logger->addError($e->getMessage());
            $this->rollbackTransaction();
        }
        return $firstResult;

    }
public function execute ( $ params = array ( ) , $ requestParams = array ( ) ) { $ deleteParams = $ params ; if ( count ( $ requestParams ) > 0 ) { $ deleteParams = $ requestParams ; } $ this -> beginTransaction ( ) ; $ firstResult = null ; try { //first delete the child tables $ this -> deleteI18nLocales ( $ deleteParams ) ; $ this -> deleteOneToOneRows ( $ deleteParams ) ; //now delete the main tables $ this -> getQueryBuilder ( ) -> where ( $ deleteParams ) ; $ query = $ this -> getQueryBuilder ( ) -> getQuery ( $ this -> entity , QueryBuilder :: DELETE_QUERY ) ; $ firstResult = $ this -> query ( $ query ) ; $ this -> commitTransaction ( ) ; } catch ( Exception $ e ) { $ this -> logger -> addError ( $ e -> getMessage ( ) ) ; $ this -> rollbackTransaction ( ) ; } return $ firstResult ; }
Deletes an entity row from the database

@param array     URI params
@param array     POST params
Deletes an entity row from the database