public function delete()
    {
        $this->eventsManager->fireEvent('model:beforeDelete', $this);

        static::query(null, $this)->where($this->_getPrimaryKeyValuePairs())->delete();

        $this->eventsManager->fireEvent('model:afterDelete', $this);

        return $this;
    }
public function delete()
    {
        $this->eventsManager->fireEvent('model:beforeDelete', $this);

        static::query(null, $this)->where($this->_getPrimaryKeyValuePairs())->delete();

        $this->eventsManager->fireEvent('model:afterDelete', $this);

        return $this;
    }
public function delete ( ) { $ this -> eventsManager -> fireEvent ( 'model:beforeDelete' , $ this ) ; static :: query ( null , $ this ) -> where ( $ this -> _getPrimaryKeyValuePairs ( ) ) -> delete ( ) ; $ this -> eventsManager -> fireEvent ( 'model:afterDelete' , $ this ) ; return $ this ; }
Deletes a model instance. Returning true on success or false otherwise.

@return static
Deletes a model instance . Returning true on success or false otherwise .