src/db/orm/PersistableObject.php
public function delete() {
        if (!$this->isPersistent()) throw new IllegalStateException('Cannot delete non-persistent '.get_class($this));

        $this->dao()->transaction(function() {
            if ($this->beforeDelete() !== true)                             // pre-processing hook
                return $this;

            if ($this->doDelete()) {                                        // perform deletion
                // reset identity property
                $idName = $this->dao()->getMapping()['identity']['name'];
                $this->$idName = null;

                $this->afterDelete();                                       // post-processing hook
            }
        });
        return $this;
    }
public function delete() {
        if (!$this->isPersistent()) throw new IllegalStateException('Cannot delete non-persistent '.get_class($this));

        $this->dao()->transaction(function() {
            if ($this->beforeDelete() !== true)                             // pre-processing hook
                return $this;

            if ($this->doDelete()) {                                        // perform deletion
                // reset identity property
                $idName = $this->dao()->getMapping()['identity']['name'];
                $this->$idName = null;

                $this->afterDelete();                                       // post-processing hook
            }
        });
        return $this;
    }
public function delete ( ) { if ( ! $ this -> isPersistent ( ) ) throw new IllegalStateException ( 'Cannot delete non-persistent ' . get_class ( $ this ) ) ; $ this -> dao ( ) -> transaction ( function ( ) { if ( $ this -> beforeDelete ( ) !== true ) // pre-processing hook return $ this ; if ( $ this -> doDelete ( ) ) { // perform deletion // reset identity property $ idName = $ this -> dao ( ) -> getMapping ( ) [ 'identity' ] [ 'name' ] ; $ this -> $ idName = null ; $ this -> afterDelete ( ) ; // post-processing hook } } ) ; return $ this ; }
Delete the instance from the storage mechanism.

@return $this
Delete the instance from the storage mechanism .