예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function setName($name)
 {
     $this->translate()->setName($name);
     $this->root->setCurrentLocale($this->getCurrentLocale());
     $this->root->setFallbackLocale($this->getFallbackLocale());
     $this->root->setName($name);
     return $this;
 }
예제 #2
0
 function it_also_sets_translation_on_root_taxon(TaxonInterface $taxon, TaxonomyTranslation $translation)
 {
     $translation->getName()->willReturn('New');
     $translation->getLocale()->shouldBeCalled();
     $translation->setTranslatable($this)->shouldBeCalled();
     $taxon->setName('New')->shouldBeCalled();
     $taxon->setTaxonomy($this)->shouldBeCalled();
     $taxon->setCurrentLocale(Argument::any())->shouldBeCalled();
     $taxon->setFallbackLocale(Argument::any())->shouldBeCalled();
     $this->setRoot($taxon);
     $this->addTranslation($translation);
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function setRoot(TaxonInterface $root)
 {
     $root->setTaxonomy($this);
     $root->setCurrentLocale($this->getCurrentLocale());
     $root->setFallbackLocale($this->getFallbackLocale());
     $this->root = $root;
 }