47 var
$fields = array(
"taxonomy_id" => Number,
48 "identifier" => String,
49 "taxonomy_name" => String,
50 "description" => HTML,
51 "associated_classes" => String,
52 "published" => Boolean,
53 "enable_facet_filter" => Boolean);
59 return Query::create(
Taxonomy,
"WHERE identifier=:i")
66 return $this->getRelatedList(TaxonomyAssociation,
"",
$constraint);
76 return Query::create(
TaxonomyTerm,
"WHERE taxonomy_id=:taxonomy AND term=:term")
77 ->bind(
":taxonomy", $this->taxonomy_id,
84 return Query::create(
TaxonomyTerm,
"WHERE taxonomy_id=:taxonomy")
85 ->bind(
":taxonomy", $this->taxonomy_id)
86 ->executeValue(
"COUNT(1)");
92 $pk = $item->getPrimaryKey();
94 return Query::create(
$class,
"WHERE $pk in (SELECT id FROM taxonomy_term_association WHERE taxonomy_id=:t AND class=:c)")
95 ->bind(
":t", $this->taxonomy_id,
102 return Query::create(
TaxonomyTerm,
"WHERE term_id IN (SELECT term_id FROM taxonomy_term_association where taxonomy_id=:t and class=:c and id=:i)")
103 ->bind(
":t", $this->taxonomy_id,
104 ":c", get_class($item),
105 ":i", $item->get($item->getPrimaryKey()))
111 $cl = get_class($item);
113 if (!isset($this->_termCache[
$cl]))
116 ->bind(
":t", $this->taxonomy_id,
117 ":c", get_class($item))
121 return $this->_termCache[
$cl][$item->get($item->getPrimaryKey())]->term_ids;
126 return Query::create(
TaxonomyTerm,
"WHERE term_id in (SELECT term_id FROM taxonomy_term_association where taxonomy_id=:id AND class=:cl) ORDER BY sort_order, term")
127 ->bind(
":id", $this->taxonomy_id,
":cl",
$class)
getAssociatedTermsByClass($class)
getAssociatedTermIds($item)
Associations($constraint="")
getAssociatedTerms($item)
static fromIdentifier($identifier)
getAssociatedItems($class)