Test Failed
Branch master (e9d41f)
by Jean-Christophe
15:30
created

DatabaseMetadatas   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 6
c 0
b 0
f 0
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTablesName() 0 2 1
A getFieldsInfos() 0 2 1
A getPrimaryKeys() 0 2 1
A getRowNum() 0 2 1
A getForeignKeys() 0 2 1
1
<?php
2
3
namespace Ubiquity\db\traits;
4
5
/**
6
 * Retreives metadatas from the database.
7
 *
8
 * Ubiquity\db\traits$DatabaseMetadatas
9
 * This class is part of Ubiquity
10
 *
11
 * @author jcheron <[email protected]>
12
 * @version 1.0.1
13
 *
14
 * @property \Ubiquity\db\providers\AbstractDbWrapper $wrapperObject
15
 */
16
trait DatabaseMetadatas {
17
18 4
	public function getTablesName() {
19 4
		return $this->wrapperObject->getTablesName ();
20
	}
21
22 1
	public function getPrimaryKeys($tableName) {
23 1
		return $this->wrapperObject->getPrimaryKeys ( $tableName );
24
	}
25
26 1
	public function getFieldsInfos($tableName) {
27 1
		return $this->wrapperObject->getFieldsInfos ( $tableName );
28
	}
29
30 1
	public function getForeignKeys($tableName, $pkName, $dbName = null) {
31 1
		return $this->wrapperObject->getForeignKeys ( $tableName, $pkName, $dbName );
32
	}
33
34
	public function getRowNum(string $tableName, string $pkName, string $condition): int {
35
		return $this->wrapperObject->getRowNum ( $tableName, $pkName, $condition );
36
	}
37
}
38
39