public function __construct(array $options = array()) { parent::__construct($options); $config = _orm_load_config('dbo', $this); $this->merge($config); $this->initDbo(); }
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'); } } } }