/**
  * {@inheritDoc}
  */
 public function count()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'count', []);
     return parent::count();
 }
Exemplo n.º 2
0
 /**
  * @param Taxonomy $taxonomy
  * @param array    $termNames ['Unix', 'Web Development', etc..]
  *
  * @return array|Term[]
  */
 protected function getTerms(Taxonomy $taxonomy, array $termNames)
 {
     $terms = [];
     foreach ($termNames as $name) {
         $term = $taxonomy->getTermByName($name);
         if (is_null($term)) {
             $message = "The Taxonomy '{$taxonomy->getName()}' does not contain term '{$name}'.";
             throw new TransformationFailure($message);
         }
         $terms[] = $term;
     }
     return $terms;
 }
Exemplo n.º 3
0
 /**
  * @param Taxonomy $taxonomy
  *
  * @return string
  */
 protected function createKey(Taxonomy $taxonomy)
 {
     return $taxonomy->getKey() . '_' . $this->getSlug();
 }