示例#1
0
 /**
  * Custom constructor to create product with assigned category
  *
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, $placeholders = [])
 {
     parent::__construct($configuration, $placeholders);
     if (isset($placeholders['categories'])) {
         $this->categories = $placeholders['categories'];
     } else {
         $this->_placeholders['category::getName'] = [$this, 'categoryProvider'];
         $this->_placeholders['category::getId'] = [$this, 'categoryProvider'];
     }
 }
示例#2
0
 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, $placeholders = [])
 {
     $placeholders['password'] = isset($placeholders['password']) ? $placeholders['password'] : '******';
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['sales_all_scopes'] = [$this, 'roleProvider'];
 }