@@ 89-100 (lines=12) @@ | ||
86 | * @return string Table column type |
|
87 | * @throws \InvalidArgumentException |
|
88 | */ |
|
89 | public function getTableColumnType(string $columnNameOrAlias) : string |
|
90 | { |
|
91 | $columnName = $this->getTableColumnName($columnNameOrAlias); |
|
92 | ||
93 | if (array_key_exists($columnName, $this->columnTypes)) { |
|
94 | return $this->columnTypes[$columnName]; |
|
95 | } |
|
96 | ||
97 | throw new \InvalidArgumentException( |
|
98 | 'Column ' . $columnNameOrAlias . ' type is not defined table ' . $this->tableName |
|
99 | ); |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * Get table column default value by column name or alias. |
|
@@ 110-121 (lines=12) @@ | ||
107 | * @return mixed Table column default value |
|
108 | * @throws \InvalidArgumentException |
|
109 | */ |
|
110 | public function getColumnDefaultValue(string $columnNameOrAlias) |
|
111 | { |
|
112 | $columnName = $this->getTableColumnName($columnNameOrAlias); |
|
113 | ||
114 | if (array_key_exists($columnName, $this->columnDefaults)) { |
|
115 | return $this->columnDefaults[$columnName]; |
|
116 | } |
|
117 | ||
118 | throw new \InvalidArgumentException( |
|
119 | 'Column ' . $columnNameOrAlias . ' type is not defined table ' . $this->tableName |
|
120 | ); |
|
121 | } |
|
122 | ||
123 | /** |
|
124 | * Get table column name by column name or alias. |