Habari\Term::object_count PHP Method

object_count() public method

Find the count of objects of a given type associated with this Term.
public object_count ( $type ) : Array
$type string. The name of the object type for which the associations are wanted.
return Array of object ids associated with this term for the given type.
    public function object_count($type)
    {
        $type_id = Vocabulary::object_type_id($type);
        $result = DB::get_value("SELECT count(object_id) FROM {object_terms} WHERE term_id = ? AND object_type_id = ?", array($this->id, $type_id));
        return $result;
    }