예제 #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_name_on_the_root_taxon(TaxonInterface $taxon)
 {
     $taxon->setName('Category')->shouldBeCalled();
     $taxon->setTaxonomy($this)->shouldBeCalled();
     $this->setRoot($taxon);
     $this->setName('Category');
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function addTranslation(TranslationInterface $translation)
 {
     parent::addTranslation($translation);
     if ($translation instanceof TaxonomyTranslation) {
         $this->root->setName($translation->getName());
     }
 }
예제 #4
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);
 }
예제 #5
0
파일: Taxonomy.php 프로젝트: nmarmon/Sylius
 /**
  * {@inheritdoc}
  */
 public function setName($name)
 {
     $this->translate()->setName($name);
     $this->root->setName($name);
     return $this;
 }