コード例 #1
0
ファイル: Taxonomy.php プロジェクト: Strontium-90/Sylius
 /**
  * {@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
ファイル: TaxonomySpec.php プロジェクト: bcremer/Sylius
 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
ファイル: Taxonomy.php プロジェクト: aleherse/Sylius
 /**
  * {@inheritdoc}
  */
 public function addTranslation(TranslationInterface $translation)
 {
     parent::addTranslation($translation);
     if ($translation instanceof TaxonomyTranslation) {
         $this->root->setName($translation->getName());
     }
 }
コード例 #4
0
ファイル: TaxonomySpec.php プロジェクト: Silwereth/Sylius
 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;
 }