/** * {@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; }
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); }
/** * {@inheritdoc} */ public function setRoot(TaxonInterface $root) { $root->setTaxonomy($this); $root->setCurrentLocale($this->getCurrentLocale()); $root->setFallbackLocale($this->getFallbackLocale()); $this->root = $root; }