public function associate($type, $id)
{
$result = true;
$type_id = Vocabulary::object_type_id($type);
Plugins::act('term_associate_to_object_before', $this->id, $id, $type_id);
if (!DB::exists("{object_terms}", array('term_id' => $this->id, 'object_id' => $id, 'object_type_id' => $type_id))) {
$result = DB::insert("{object_terms}", array('term_id' => $this->id, 'object_id' => $id, 'object_type_id' => $type_id));
}
Plugins::act('term_associate_to_object_after', $this->id, $id, $type_id);
return $result;
}