Example #1
0
 /**
  * Builds the string for the SQL assignment operation of the given column.
  *
  * @param string $tableName A table name.
  * @param string $columnName A column name.
  * @param string $value A value to assign.
  *
  * @return string
  */
 public function prepareAssignment($tableName, $columnName, $value)
 {
     $tableField = $this->connection->getTableField($tableName, $columnName);
     return $this->quote($columnName) . ' = ' . $this->convertToDb($value, $tableField);
 }
 protected function upDbHelpers()
 {
     if (!$this->connection->getTableField('b_disk_object', 'WEBDAV_ELEMENT_ID')) {
         $this->connection->queryExecute("ALTER TABLE b_disk_object ADD WEBDAV_ELEMENT_ID INT");
     }
     if (!$this->connection->getTableField('b_disk_object', 'WEBDAV_SECTION_ID')) {
         $this->connection->queryExecute("ALTER TABLE b_disk_object ADD WEBDAV_SECTION_ID INT");
     }
     if (!$this->connection->getTableField('b_disk_object', 'WEBDAV_IBLOCK_ID')) {
         $this->connection->queryExecute("ALTER TABLE b_disk_object ADD WEBDAV_IBLOCK_ID INT");
     }
     if (!$this->connection->getTableField('b_disk_version', 'BP_VERSION_ID')) {
         $this->connection->queryExecute("ALTER TABLE b_disk_version ADD BP_VERSION_ID INT");
     }
     try {
         $this->connection->createIndex('b_disk_storage', 'IX_TMP_DISK_S_1', 'ROOT_OBJECT_ID');
         $this->connection->createIndex('b_disk_object', 'IX_TMP_DISK_E_2', 'WEBDAV_ELEMENT_ID');
         $this->connection->createIndex('b_disk_object', 'IX_TMP_DISK_S_2', 'WEBDAV_SECTION_ID');
         $this->connection->createIndex('b_disk_object', 'IX_TMP_DISK_IIS_2', 'WEBDAV_IBLOCK_ID');
     } catch (Exception $e) {
     }
 }