예제 #1
0
파일: Product.php 프로젝트: sidibea/Sylius
 /**
  * {@inheritdoc}
  */
 public function getTaxons($taxonomy = null)
 {
     if (null !== $taxonomy) {
         return $this->taxons->filter(function (BaseTaxonInterface $taxon) use($taxonomy) {
             return $taxonomy === strtolower($taxon->getTaxonomy()->getName());
         });
     }
     return $this->taxons;
 }
예제 #2
0
파일: Product.php 프로젝트: origammi/Sylius
 /**
  * {@inheritdoc}
  */
 public function getTaxons($rootTaxonCode = null)
 {
     if (null !== $rootTaxonCode) {
         return $this->taxons->filter(function (BaseTaxonInterface $taxon) use($rootTaxonCode) {
             return $rootTaxonCode === strtolower($taxon->getRoot()->getCode());
         });
     }
     return $this->taxons;
 }