/** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity * @param \Magento\Framework\Locale\FormatInterface $localeFormat * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param array $data */ public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, \Magento\Framework\Locale\FormatInterface $localeFormat, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, $data = array()) { $this->_eavConfig = $eavConfig; $this->_resource = $resource; $this->_attrSetEntity = $attrSetEntity; $this->_localeFormat = $localeFormat; $this->_resourceHelper = $resourceHelper; $this->_universalFactory = $universalFactory; parent::__construct(); $properties = get_object_vars($this); foreach ($data as $key => $value) { if (array_key_exists('_' . $key, $properties)) { $this->{'_' . $key} = $value; } } }
/** * Class constructor * * @param \Magento\Framework\Model\Resource\Db\Context $context * @param string|null $resourcePrefix */ public function __construct(\Magento\Framework\Model\Resource\Db\Context $context, $resourcePrefix = null) { $this->transactionManager = $context->getTransactionManager(); $this->_resources = $context->getResources(); $this->objectRelationProcessor = $context->getObjectRelationProcessor(); if ($resourcePrefix !== null) { $this->_resourcePrefix = $resourcePrefix; } parent::__construct(); }
/** * @param Context $context * @param array $data */ public function __construct(Context $context, $data = []) { $this->_eavConfig = $context->getEavConfig(); $this->_resource = $context->getResource(); $this->_attrSetEntity = $context->getAttributeSetEntity(); $this->_localeFormat = $context->getLocaleFormat(); $this->_resourceHelper = $context->getResourceHelper(); $this->_universalFactory = $context->getUniversalFactory(); $this->transactionManager = $context->getTransactionManager(); $this->objectRelationProcessor = $context->getObjectRelationProcessor(); parent::__construct(); $properties = get_object_vars($this); foreach ($data as $key => $value) { if (array_key_exists('_' . $key, $properties)) { $this->{'_' . $key} = $value; } } }
/** * Class constructor * * @param \Magento\Framework\App\Resource $resource */ public function __construct(\Magento\Framework\App\Resource $resource) { $this->_resources = $resource; parent::__construct(); }