Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
DbModelsCreator.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\orm\creator\database
;
4
5
use
Ubiquity\orm\creator\ModelsCreator
;
6
use
Ubiquity\db\Database
;
7
18
class
DbModelsCreator
extends
ModelsCreator
{
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\db\Database
Ubiquity Generic database class.
Definition
Database.php:25
Ubiquity\orm\creator\ModelsCreator
Definition
ModelsCreator.php:19
Ubiquity\orm\creator\ModelsCreator\$config
$config
Definition
ModelsCreator.php:23
Ubiquity\orm\creator\database\DbModelsCreator
Definition
DbModelsCreator.php:18
Ubiquity\orm\creator\database\DbModelsCreator\getForeignKeys
getForeignKeys($tableName, $pkName, $dbName=null)
Definition
DbModelsCreator.php:47
Ubiquity\orm\creator\database\DbModelsCreator\$database
$database
Definition
DbModelsCreator.php:23
Ubiquity\orm\creator\database\DbModelsCreator\connect
connect($dbConfig)
Definition
DbModelsCreator.php:30
Ubiquity\orm\creator\database\DbModelsCreator\getFieldsInfos
getFieldsInfos($tableName)
Definition
DbModelsCreator.php:39
Ubiquity\orm\creator\database\DbModelsCreator\getPrimaryKeys
getPrimaryKeys($tableName)
Definition
DbModelsCreator.php:43
Ubiquity\orm\creator\database\DbModelsCreator\getTablesName
getTablesName()
Definition
DbModelsCreator.php:35
Ubiquity\orm\creator\database\DbModelsCreator\init
init($config, $offset='default')
Definition
DbModelsCreator.php:25
Ubiquity\orm\creator\database
Definition
DbModelsCreator.php:3
Ubiquity
Class Configuration \config.
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity-dev
src
Ubiquity
orm
creator
database
DbModelsCreator.php
Generated on Sun Dec 10 2023 15:04:08 for
Ubiquity
by
doxygen
1.9.8