public function visitTaxonomyNode(SpecificationInterface $specification, SpecificationWalker $walker, $query) { $taxonomyNode = $specification->getTaxonomyNode(); //Do we already have the taxonomy node? if (null != $taxonomyNode) { $query->from($taxonomyNode); //If not we need to describe the taxonomy node } else { $query->field('taxonomies.name')->equals($specification->getName()); } }
public function visitTaxonomyNode(SpecificationInterface $specification, SpecificationWalker $walker, $query) { $taxonomyNode = $specification->getTaxonomyNode(); //Do we already have the taxonomy node? if (null != $taxonomyNode) { $query->field('taxonomies')->equals($taxonomyNode); //If not we need to describe the taxonomy node } else { //Todo: use taxonomy path instead of the slug $query->field('taxonomies.slug')->equals(strtolower($specification->getTaxonomyNodeName())); } }
public function visitTaxonomyNode(SpecificationInterface $specification, SpecificationWalker $walker, $query) { $taxonomyNode = $specification->getTaxonomyNode(); //Do we already have the taxonomy node? if (null != $taxonomyNode) { // $query->field('taxonomies')->equals($taxonomyNode); //If not we need to describe the taxonomy node } else { $rootAlias = $query->getRootAlias(); $query->innerJoin($rootAlias . '.taxonomies', 't'); $parameterId = $this->generateParameterId(); $query->andWhere('t.name =?' . $parameterId); $query->setParameter($parameterId, $specification->getTaxonomyNodeName()); } }