src/Charcoal/Admin/Widget/FormSidebarWidget.php
public function isObjDeletable()
    {
        if ($this->isObjDeletable === null) {
            // Overridden by permissions
            if (!$this->checkPermission('delete') || !$this->form()) {
                $this->isObjDeletable = false;
            } else {
                $obj = $this->form()->obj();
                $this->isObjDeletable = !!$obj->id();

                $method = [ $obj, 'isDeletable' ];
                if (is_callable($method)) {
                    $this->isObjDeletable = call_user_func($method);
                }
            }
        }

        return $this->isObjDeletable;
    }
public function isObjDeletable()
    {
        if ($this->isObjDeletable === null) {
            // Overridden by permissions
            if (!$this->checkPermission('delete') || !$this->form()) {
                $this->isObjDeletable = false;
            } else {
                $obj = $this->form()->obj();
                $this->isObjDeletable = !!$obj->id();

                $method = [ $obj, 'isDeletable' ];
                if (is_callable($method)) {
                    $this->isObjDeletable = call_user_func($method);
                }
            }
        }

        return $this->isObjDeletable;
    }
public function isObjDeletable ( ) { if ( $ this -> isObjDeletable === null ) { // Overridden by permissions if ( ! $ this -> checkPermission ( 'delete' ) || ! $ this -> form ( ) ) { $ this -> isObjDeletable = false ; } else { $ obj = $ this -> form ( ) -> obj ( ) ; $ this -> isObjDeletable = ! ! $ obj -> id ( ) ; $ method = [ $ obj , 'isDeletable' ] ; if ( is_callable ( $ method ) ) { $ this -> isObjDeletable = call_user_func ( $ method ) ; } } } return $ this -> isObjDeletable ; }
Determine if the object can be deleted.

If TRUE, the "Delete" button is shown. The object can still be
deleted programmatically or via direct action on the database.

@return boolean
Determine if the object can be deleted .