Example #1
0
 /**
  * @inheritdoc
  *
  * @throws ArgumentNullException Empty parameters in the filter
  * @throws LoaderException Module "iblock" not installed
  */
 public function __construct(array $filter, $silenceMode = false)
 {
     if (!Loader::includeModule('highloadblock')) {
         throw new LoaderException('Failed include module "highloadblock"');
     }
     parent::__construct($filter, $silenceMode);
     $filter = $this->prepareFilter($filter);
     if (isset($filter['name'])) {
         $this->name = $filter['name'];
     }
     if (isset($filter['id'])) {
         $this->id = $filter['id'];
     } else {
         $this->id = $this->getFromCache(['type' => 'id']);
     }
 }
Example #2
0
 /**
  * @inheritdoc
  *
  * @throws ArgumentNullException Empty parameters in the filter
  * @throws LoaderException Module "iblock" not installed
  */
 public function __construct(array $filter, $silenceMode = false)
 {
     if (!Loader::includeModule('iblock')) {
         throw new LoaderException('Failed include module "iblock"');
     }
     parent::__construct($filter, $silenceMode);
     $filter = $this->prepareFilter($filter);
     if (isset($filter['type'])) {
         $this->type = $filter['type'];
     }
     if (isset($filter['code'])) {
         $this->code = $filter['code'];
     }
     if (isset($filter['id'])) {
         $this->id = $filter['id'];
     } else {
         $this->id = $this->getFromCache(['type' => 'id'], static::CACHE_SHARD_LITE);
     }
 }