Пример #1
0
 public function __construct(array $data = array())
 {
     parent::__construct($data);
     $this->loadRevision();
     $this->loadCollection();
     $this->initModel();
     $config = _orm_load_config('dbo', $this);
     if (isset($config['database']) && !empty($config['database'])) {
         $this->setDatabase($config['database']);
     }
     if (!$this->hasDatabaseName()) {
         $this->exception('Missing database name');
     } else {
         if (!$this->hasTableName()) {
             $this->exception('Missing table name');
         } else {
             if (!$this->hasFields()) {
                 $this->exception('Missing fields');
             }
         }
     }
 }
Пример #2
0
 public function __construct(array $data = array())
 {
     parent::__construct($data);
     $this->loadDefaults();
 }