Пример #1
0
 /**
  * 初始化信息
  * @param array $data
  */
 public function __construct(array $data = [])
 {
     parent::__construct($data);
     foreach (static::$config as $name => $realName) {
         $this->set($name, isset($_SERVER[$realName]) ? trim($_SERVER[$realName]) : null);
     }
     $this->init();
 }
Пример #2
0
 /**
  * __construct
  * @param mixed $data
  * @param string $format
  * @param string $name
  */
 public function __construct($data = [], $format = 'php', $name = 'box1')
 {
     // Optionally load supplied data.
     if (is_array($data) || is_object($data)) {
         $this->bindData($this->data, $data);
     } elseif ($data && is_string($data)) {
         $this->load($data, $format);
     }
     parent::__construct();
     $this->name = $name;
 }
Пример #3
0
 public function sets($data)
 {
     // except column at set.
     foreach ($this->excepted as $column) {
         if (isset($data[$column])) {
             unset($data[$column]);
         }
     }
     return parent::sets($data);
 }