Habari\Term::delete PHP Method

delete() public method

Delete an existing term
public delete ( )
    public function delete()
    {
        // Let plugins disallow and act before we write to the database
        $allow = true;
        $allow = Plugins::filter('term_delete_allow', $allow, $this);
        if (!$allow) {
            return false;
        }
        Plugins::act('term_delete_before', $this);
        // Delete all info records associated with this comment
        $this->info->delete_all();
        DB::query('DELETE FROM {object_terms} WHERE term_id = :id', array('id' => $this->id));
        $result = parent::deleteRecord('{terms}', array('id' => $this->id));
        EventLog::log(_t('Term %1$s (%2$s) deleted.', array($this->id, $this->term_display)), 'info', 'content', 'habari');
        // Let plugins act after we write to the database
        Plugins::act('term_delete_after', $this);
        return $result;
    }