149 $firstDocumentId = \CBPHelper::parseDocumentId($paramFirstDocumentId);
150 $secondDocumentId = \CBPHelper::parseDocumentId($paramSecondDocumentId);
152 $connection = Main\Application::getConnection();
153 $sqlHelper = $connection->getSqlHelper();
154 $table = $sqlHelper->forSql(static::getTableName());
156 $firstDocId = $sqlHelper->forSql($firstDocumentId[2]);
157 $firstEntity = $sqlHelper->forSql($firstDocumentId[1]);
158 $firstModule = $sqlHelper->forSql($firstDocumentId[0]);
160 $secondDocId = $sqlHelper->forSql($secondDocumentId[2]);
161 $secondEntity = $sqlHelper->forSql($secondDocumentId[1]);
162 $secondModule = $sqlHelper->forSql($secondDocumentId[0]);
164 $connection->queryExecute(
"UPDATE {$table}
166 DOCUMENT_ID = '{$firstDocId}',
167 ENTITY = '{$firstEntity}',
168 MODULE_ID = '{$firstModule}'
170 DOCUMENT_ID = '{$secondDocId}'
171 AND ENTITY = '{$secondEntity}'
172 AND MODULE_ID = '{$secondModule}'
180 $oldType = \CBPHelper::parseDocumentId($paramOldType);
181 $newType = \CBPHelper::parseDocumentId($paramNewType);
183 $connection = Main\Application::getConnection();
184 $sqlHelper = $connection->getSqlHelper();
185 $table = $sqlHelper->forSql(static::getTableName());
187 $firstEntity = $sqlHelper->forSql($oldType[1]);
188 $firstModule = $sqlHelper->forSql($oldType[0]);
190 $secondEntity = $sqlHelper->forSql($newType[1]);
191 $secondModule = $sqlHelper->forSql($newType[0]);
193 $templates = implode(
",", array_map(
'intval', $workflowTemplateIds));
195 $connection->queryExecute(
"UPDATE {$table}
197 ENTITY = '{$firstEntity}',
198 MODULE_ID = '{$firstModule}'
200 ENTITY = '{$secondEntity}'
201 AND MODULE_ID = '{$secondModule}'
202 AND WORKFLOW_TEMPLATE_ID IN ({$templates})