示例#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
 /**
  * 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];
 }
 /**
  * {@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);
     }
 }