public function __construct(array $records)
 {
     $this->addValidator(function ($record) {
         if (!$record instanceof UploadRecord) {
             throw new \InvalidArgumentException('Record must be an instance of UploadRecord');
         }
     });
     $this->setKey(function (UploadRecord $record) {
         return $record->getPageID();
     });
     parent::__construct($records);
 }
Exemplo n.º 2
0
 /**
  * @param UserTypeInterface $type
  */
 public function __construct(UserTypeInterface $type)
 {
     $this->_type = $type;
     parent::__construct();
 }
 /**
  * @param array $generators
  * @param $default
  */
 public function __construct(array $generators, $default)
 {
     parent::__construct($generators);
     $this->setDefault($default);
 }