1 | <?php |
||
6 | trait OrmEntityAnalyzer |
||
7 | { |
||
8 | /** |
||
9 | * Include mapping related functionality |
||
10 | */ |
||
11 | use OrmMapping; |
||
12 | |||
13 | /** |
||
14 | * Get the name of table |
||
15 | * |
||
16 | * @param string $class |
||
17 | * The name of class |
||
18 | * |
||
19 | * @return string The name of table |
||
20 | * |
||
21 | * @throws OrmException |
||
22 | */ |
||
23 | 32 | private static function getTableName(string $class): string |
|
31 | |||
32 | /** |
||
33 | * Retrieve the primary key value |
||
34 | * |
||
35 | * @param string $class |
||
36 | * The name of class where to retrieve the primary key value |
||
37 | * |
||
38 | * @param AbstractModel $object |
||
39 | * The object instance |
||
40 | * |
||
41 | * @param bool $onlyValue |
||
42 | * Whether to retrieve only primary key value or both, value and column name |
||
43 | * |
||
44 | * @return array Pair of column name and value of primary key or value only |
||
45 | * |
||
46 | * @throws OrmException |
||
47 | */ |
||
48 | 16 | private static function getPrimaryKey(string $class, AbstractModel $object, bool $onlyValue = false) |
|
73 | |||
74 | /** |
||
75 | * Retrieve the name of column which represents the primary key |
||
76 | * |
||
77 | * @param string $class |
||
78 | * The name of class |
||
79 | * |
||
80 | * @return string The name of primary key column |
||
81 | * |
||
82 | * @throws OrmException |
||
83 | */ |
||
84 | 17 | private static function getPrimaryKeyCol(string $class): string |
|
98 | } |
||
99 |