Habari\Term::dissociate PHP Метод

dissociate() публичный Метод

Disassociate this term from an object of a certain type via its id.
public dissociate ( $type = null, $id = null )
$type string. The name of the object type we want to unset an association for
$id integer. The object's id
    public function dissociate($type = null, $id = null)
    {
        $result = true;
        $type_id = Vocabulary::object_type_id($type);
        Plugins::act('term_dissociate_from_object_before', $this->id, $id, $type_id);
        $result = DB::query("DELETE FROM {object_terms} WHERE term_id = ? AND object_id = ? AND object_type_id = ?", array($this->id, $id, $type_id));
        Plugins::act('term_dissociate_from_object_after', $this->id, $id, $type_id, $result);
        return $result;
    }