Пример #1
0
 public function __construct($config = array())
 {
     if (isset($config['data']) && !isset($config['items'])) {
         $config['items'] = $config['data'];
         unset($config['data']);
     }
     parent::__construct($config);
     $this->_items = (array) $this->_items;
 }
Пример #2
0
 /**
  * Class constructor.
  *
  * @param array $config
  */
 public function __construct(array $config = array())
 {
     $defaults = array('data' => array(), 'model' => null);
     parent::__construct($config + $defaults);
 }
Пример #3
0
 /**
  * Class constructor
  *
  * @param array $config
  * @return void
  */
 public function __construct(array $config = array())
 {
     $defaults = array('data' => array(), 'handle' => null, 'model' => null);
     parent::__construct($config + $defaults);
     foreach (array('data', 'classes', 'handle', 'model', 'result', 'query') as $key) {
         unset($this->_config[$key]);
     }
     if (!is_array($this->_data)) {
         $message = 'Error creating new Collection instance; data format invalid.';
         throw new RuntimeException($message);
     }
 }