Habari\Block::delete PHP Method

delete() public method

Delete this block
public delete ( )
    public function delete()
    {
        // Let plugins disallow and act before we write to the database
        $allow = true;
        $allow = Plugins::filter('block_delete_allow', $allow, $this);
        if (!$allow) {
            return false;
        }
        Plugins::act('block_delete_before', $this);
        $result = parent::deleteRecord('{blocks_areas}', array('block_id' => $this->id));
        $result = $result && parent::deleteRecord('{blocks}', array('id' => $this->id));
        EventLog::log(_t('Block %1$s (%2$s) deleted.', array($this->id, $this->title)), 'info', 'content', 'habari');
        // Let plugins act after we write to the database
        Plugins::act('block_delete_after', $this);
        return $result;
    }