コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function addSetInfo($entityType, array $attributes, $setId = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'addSetInfo');
     if (!$pluginInfo) {
         return parent::addSetInfo($entityType, $attributes, $setId);
     } else {
         return $this->___callPlugins('addSetInfo', func_get_args(), $pluginInfo);
     }
 }
コード例 #2
0
ファイル: AbstractEntity.php プロジェクト: aiesh/magento2
 /**
  * Retrieve sorted attributes
  *
  * @param int $setId
  * @return array
  */
 public function getSortedAttributes($setId = null)
 {
     $attributes = $this->getAttributesByCode();
     if ($setId === null) {
         $setId = $this->getEntityType()->getDefaultAttributeSetId();
     }
     // initialize set info
     $this->_attrSetEntity->addSetInfo($this->getEntityType(), $attributes, $setId);
     foreach ($attributes as $code => $attribute) {
         /* @var $attribute AbstractAttribute */
         if (!$attribute->isInSet($setId)) {
             unset($attributes[$code]);
         }
     }
     $this->_sortingSetId = $setId;
     uasort($attributes, array($this, 'attributesCompare'));
     return $attributes;
 }