Test Failed
Pull Request — master (#100)
by
unknown
17:04
created

AbstractDriverMetaDatas   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 39
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
1
<?php
2
3
namespace Ubiquity\db\providers\pdo\drivers;
4
5
/**
6
 * Ubiquity\db\providers$DriverMetaDatas
7
 * This class is part of Ubiquity
8
 *
9
 * @author jc
10
 * @version 1.0.0
11
 *
12
 */
13
abstract class AbstractDriverMetaDatas {
14
	protected $dbInstance;
15
16
	public function __construct($dbInstance) {
17
		$this->dbInstance = $dbInstance;
18
	}
19
20
	/**
21
	 * Returns all table names in the database.
22
	 *
23
	 * @return array
24
	 */
25
	abstract public function getTablesName(): array;
26
27
	/**
28
	 * Returns an array of the primary keys field names.
29
	 *
30
	 * @param string $tableName
31
	 * @return array
32
	 */
33
	abstract public function getPrimaryKeys(string $tableName): array;
34
35
	/**
36
	 * Returns the list of foreign keys in a table.
37
	 *
38
	 * @param string $tableName
39
	 * @param string $pkName
40
	 * @param string $dbName
41
	 * @return array
42
	 */
43
	abstract public function getForeignKeys(string $tableName, string $pkName, ?string $dbName = null): array;
44
45
	/**
46
	 * Returns metadata related to the fields of the specified table.
47
	 *
48
	 * @param string $tableName
49
	 * @return array
50
	 */
51
	abstract public function getFieldsInfos(string $tableName): array;
52
}
53
54