src/UthandoCommon/Service/AbstractMapperService.php
public function delete($id)
    {
        $model = $this->getById($id);

        $argv = compact('id', 'model');
        $argv = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_PRE_DELETE, $this, $argv);

        $result = $this->getMapper()->delete([
            $this->getMapper()->getPrimaryKey() => $id
        ]);

        if ($result) {
            $this->removeCacheItem($id);
            $argv = compact('id', 'model', 'result');
            $argv = $this->prepareEventArguments($argv);
            $this->getEventManager()->trigger(self::EVENT_POST_DELETE, $this, $argv);
        }

        return $result;
    }
public function delete($id)
    {
        $model = $this->getById($id);

        $argv = compact('id', 'model');
        $argv = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_PRE_DELETE, $this, $argv);

        $result = $this->getMapper()->delete([
            $this->getMapper()->getPrimaryKey() => $id
        ]);

        if ($result) {
            $this->removeCacheItem($id);
            $argv = compact('id', 'model', 'result');
            $argv = $this->prepareEventArguments($argv);
            $this->getEventManager()->trigger(self::EVENT_POST_DELETE, $this, $argv);
        }

        return $result;
    }
public function delete ( $ id ) { $ model = $ this -> getById ( $ id ) ; $ argv = compact ( 'id' , 'model' ) ; $ argv = $ this -> prepareEventArguments ( $ argv ) ; $ this -> getEventManager ( ) -> trigger ( self :: EVENT_PRE_DELETE , $ this , $ argv ) ; $ result = $ this -> getMapper ( ) -> delete ( [ $ this -> getMapper ( ) -> getPrimaryKey ( ) => $ id ] ) ; if ( $ result ) { $ this -> removeCacheItem ( $ id ) ; $ argv = compact ( 'id' , 'model' , 'result' ) ; $ argv = $ this -> prepareEventArguments ( $ argv ) ; $ this -> getEventManager ( ) -> trigger ( self :: EVENT_POST_DELETE , $ this , $ argv ) ; } return $ result ; }
delete row from database

@param int $id
@return int $result number of rows affected
delete row from database