1 | <?php |
||
24 | class Field extends Component |
||
25 | { |
||
26 | /** |
||
27 | * @param DomainsField $field |
||
28 | * @return bool |
||
29 | * @throws \yii\db\Exception |
||
30 | */ |
||
31 | public function delete(DomainsField $field): bool |
||
41 | |||
42 | /** |
||
43 | * @param DomainsField $field |
||
44 | * @return bool |
||
45 | * @throws Exception |
||
46 | * @throws \Exception |
||
47 | * @throws \Throwable |
||
48 | */ |
||
49 | public function save(DomainsField $field): bool |
||
69 | |||
70 | /** |
||
71 | * @param string $newName |
||
72 | * @param string|null $oldName |
||
73 | * @return bool |
||
74 | * @throws \Exception |
||
75 | * @throws \Throwable |
||
76 | */ |
||
77 | protected function handleTableName(string $newName, string $oldName = null): bool |
||
95 | |||
96 | /** |
||
97 | * Returns the content table name for a given field. |
||
98 | * |
||
99 | * @param DomainsField $field The field. |
||
100 | * @param bool $useOldHandle Whether the method should use the field’s old handle when determining the |
||
101 | * table name (e.g. to get the existing table name, rather than the new one). |
||
102 | * |
||
103 | * @return string|null The table name, or `false` if $useOldHandle was set to `true` and there was no old handle. |
||
104 | */ |
||
105 | public function getTableName(DomainsField $field, bool $useOldHandle = false) |
||
109 | |||
110 | /** |
||
111 | * Returns the content table alias for a given field. |
||
112 | * |
||
113 | * @param DomainsField $field The field. |
||
114 | * @param bool $useOldHandle Whether the method should use the field’s old handle when determining the |
||
115 | * table alias (e.g. to get the existing table alias, rather than the new one). |
||
116 | * |
||
117 | * @return string|null The table alias, or `false` if $useOldHandle was set to `true` and there was no old handle. |
||
118 | */ |
||
119 | public function getTableAlias(DomainsField $field, bool $useOldHandle = false) |
||
135 | |||
136 | /** |
||
137 | * @param string $tableName |
||
138 | * @return bool |
||
139 | * @throws \Throwable |
||
140 | */ |
||
141 | private function createTable(string $tableName): bool |
||
153 | |||
154 | /** |
||
155 | * @param DomainsField $field |
||
156 | * @param DomainsQuery $query |
||
157 | * @param bool $static |
||
158 | * @return null|string |
||
159 | * @throws Exception |
||
160 | * @throws \Twig_Error_Loader |
||
161 | */ |
||
162 | public function getTableHtml(DomainsField $field, DomainsQuery $query, bool $static) |
||
199 | } |
||
200 |