Example #1
0
 /**
  * @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;
         }
     }
 }