Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DbModelsCreator.php
Go to the documentation of this file.
1<?php
2
4
7
19
23 private $database;
24
25 protected function init($config, $offset = 'default') {
26 parent::init ( $config, $offset );
27 $this->connect ( $this->config );
28 }
29
30 private function connect($dbConfig) {
31 $this->database=new Database($dbConfig ['wrapper'] ?? \Ubiquity\db\providers\pdo\PDOWrapper::class, $dbConfig ['type'], $dbConfig ['dbName'], $dbConfig ['serverName'] ?? '127.0.0.1', $dbConfig ['port'] ?? 3306, $dbConfig ['user'] ?? 'root', $dbConfig ['password'] ?? '', $dbConfig ['options'] ?? [ ], $dbConfig ['cache'] ?? false);
32 $this->database->connect();
33 }
34
35 protected function getTablesName() {
36 return $this->database->getTablesName();
37 }
38
39 protected function getFieldsInfos($tableName) {
40 return $this->database->getFieldsInfos($tableName);
41 }
42
43 protected function getPrimaryKeys($tableName) {
44 return $this->database->getPrimaryKeys($tableName);
45 }
46
47 protected function getForeignKeys($tableName, $pkName,$dbName=null) {
48 return $this->database->getForeignKeys($tableName, $pkName,$dbName);
49 }
50}
Ubiquity Generic database class.
Definition Database.php:25
getForeignKeys($tableName, $pkName, $dbName=null)
Class Configuration \config.