コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function save(\Magento\Framework\Model\AbstractModel $object)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'save');
     if (!$pluginInfo) {
         return parent::save($object);
     } else {
         return $this->___callPlugins('save', func_get_args(), $pluginInfo);
     }
 }
コード例 #2
0
ファイル: Product.php プロジェクト: whoople/magento2-testing
 /**
  * Retrieve attribute by code
  *
  * @param string $attrCode
  * @return mixed
  */
 public function retrieveAttributeByCode($attrCode)
 {
     if (!$this->_resource) {
         $this->_resource = $this->_resourceFactory->create();
     }
     if (!isset($this->_attributeCache[$attrCode])) {
         $this->_attributeCache[$attrCode] = $this->_resource->getAttribute($attrCode);
     }
     return $this->_attributeCache[$attrCode];
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function getValidationRulesBeforeSave()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getValidationRulesBeforeSave');
     if (!$pluginInfo) {
         return parent::getValidationRulesBeforeSave();
     } else {
         return $this->___callPlugins('getValidationRulesBeforeSave', func_get_args(), $pluginInfo);
     }
 }