src/Charcoal/Source/StorableTrait.php
final public function delete()
    {
        $pre = $this->preDelete();
        if ($pre === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; cancelled by %s::preDelete()',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $ret = $this->source()->deleteItem($this);
        if ($ret === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; repository failed for %s',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $del = $this->postDelete();
        if ($del === false) {
            $this->logger->warning(sprintf(
                'Deleted object "%s:%s" but %s::postDelete() failed',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        return true;
    }
final public function delete()
    {
        $pre = $this->preDelete();
        if ($pre === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; cancelled by %s::preDelete()',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $ret = $this->source()->deleteItem($this);
        if ($ret === false) {
            $this->logger->error(sprintf(
                'Can not delete object "%s:%s"; repository failed for %s',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $del = $this->postDelete();
        if ($del === false) {
            $this->logger->warning(sprintf(
                'Deleted object "%s:%s" but %s::postDelete() failed',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        return true;
    }
final public function delete ( ) { $ pre = $ this -> preDelete ( ) ; if ( $ pre === false ) { $ this -> logger -> error ( sprintf ( 'Can not delete object "%s:%s"; cancelled by %s::preDelete()' , $ this -> objType ( ) , $ this -> id ( ) , get_called_class ( ) ) ) ; return false ; } $ ret = $ this -> source ( ) -> deleteItem ( $ this ) ; if ( $ ret === false ) { $ this -> logger -> error ( sprintf ( 'Can not delete object "%s:%s"; repository failed for %s' , $ this -> objType ( ) , $ this -> id ( ) , get_called_class ( ) ) ) ; return false ; } $ del = $ this -> postDelete ( ) ; if ( $ del === false ) { $ this -> logger -> warning ( sprintf ( 'Deleted object "%s:%s" but %s::postDelete() failed' , $ this -> objType ( ) , $ this -> id ( ) , get_called_class ( ) ) ) ; return false ; } return true ; }
Delete an object from storage.

@return boolean TRUE on success.
Delete an object from storage .