1 | <?php |
||
13 | class BitrixMigration implements MigrationInterface |
||
14 | { |
||
15 | /** |
||
16 | * DB connection. |
||
17 | * |
||
18 | * @var Connection |
||
19 | */ |
||
20 | protected $db; |
||
21 | |||
22 | /** |
||
23 | * Constructor. |
||
24 | */ |
||
25 | public function __construct() |
||
29 | |||
30 | /** |
||
31 | * Run the migration. |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function up() |
||
39 | |||
40 | /** |
||
41 | * Reverse the migration. |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function down() |
||
49 | |||
50 | /** |
||
51 | * Find iblock id by its code. |
||
52 | * |
||
53 | * @param string $code |
||
54 | * @param null|string $iBlockType |
||
55 | * |
||
56 | * @throws MigrationException |
||
57 | * |
||
58 | * @return int |
||
59 | */ |
||
60 | protected function getIblockIdByCode($code, $iBlockType = null) |
||
83 | |||
84 | /** |
||
85 | * Delete iblock by its code. |
||
86 | * |
||
87 | * @param string $code |
||
88 | * |
||
89 | * @throws MigrationException |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | protected function deleteIblockByCode($code) |
||
105 | |||
106 | /** |
||
107 | * Add iblock element property. |
||
108 | * |
||
109 | * @param array $fields |
||
110 | * |
||
111 | * @throws MigrationException |
||
112 | * |
||
113 | * @return int |
||
114 | */ |
||
115 | public function addIblockElementProperty($fields) |
||
126 | |||
127 | /** |
||
128 | * Delete iblock element property. |
||
129 | * |
||
130 | * @param string $code |
||
131 | * @param string|int $iblockId |
||
132 | * |
||
133 | * @throws MigrationException |
||
134 | */ |
||
135 | public function deleteIblockElementPropertyByCode($iblockId, $code) |
||
149 | |||
150 | /** |
||
151 | * Add User Field. |
||
152 | * |
||
153 | * @param $fields |
||
154 | * |
||
155 | * @throws MigrationException |
||
156 | * |
||
157 | * @return int |
||
158 | */ |
||
159 | public function addUF($fields) |
||
179 | |||
180 | /** |
||
181 | * Get UF by its code. |
||
182 | * |
||
183 | * @param string $entity |
||
184 | * @param string $code |
||
185 | * |
||
186 | * @throws MigrationException |
||
187 | */ |
||
188 | public function getUFIdByCode($entity, $code) |
||
210 | |||
211 | /** |
||
212 | * @param $code |
||
213 | * @param $iblockId |
||
214 | * |
||
215 | * @throws MigrationException |
||
216 | * |
||
217 | * @return array |
||
218 | */ |
||
219 | protected function getIblockPropIdByCode($code, $iblockId) |
||
233 | } |
||
234 |