Пример #1
0
 protected function __construct()
 {
     parent::__construct();
     $this->db = \Core\DB::getInstance();
     $words = preg_split("/(?=[A-Z]+)/", get_class($this), -1, PREG_SPLIT_NO_EMPTY);
     $words = array_slice($words, 1);
     foreach ($words as $i => $word) {
         $words[$i] = strtolower($word);
     }
     $this->table = str_replace("model\\", "", join("_", $words));
 }
Пример #2
0
 protected function __construct()
 {
     parent::__construct();
     global $DB;
     $this->handler = $this->connect($DB['host'], $DB['db'], $DB['uname'], $DB['pwd']);
 }