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

AbstractDriverMetaDatas::toStringOperator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
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.1
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
	 * Returns the line number of a data record.
55
	 *
56
	 * @param string $tableName
57
	 * @param string $pkName
58
	 * @param string $condition
59
	 * @return int
60
	 */
61
	abstract public function getRowNum(string $tableName, string $pkName, string $condition): int;
62
63
	/**
64
	 * Returns the SQL callback for fields concatenation
65
	 *
66
	 * @param string $fields
67
	 * @return string
68
	 */
69
	abstract public function groupConcat(string $fields, string $separator): string;
70
71
	public function toStringOperator() {
72
		return '';
73
	}
74
}
75
76