예제 #1
0
 /**
  * Конструктор класса. Заполняет атрибуты класса значениями по умолчанию.
  * @param $sTable -- имя таблицы для работы (без префикса).
  */
 function __construct($sTable = '')
 {
     global $ks_db;
     $this->obDB = $ks_db;
     if (!is_array(self::$dbStructure)) {
         if (file_exists(KS_ROOT_DIR . '/bitrix/modules/koloslib/cache/db_structure.php')) {
             $arStructure = array();
             include KS_ROOT_DIR . '/bitrix/modules/koloslib/cache/db_structure.php';
             self::$dbStructure = $arStructure;
         } else {
             self::$dbStructure = array();
         }
     }
     $this->sTable = $sTable;
     $this->auto_fields = array();
     $this->check_fields = array();
     $this->checkMethod = 'AND';
     $this->arTables = array();
     $this->bDistinctMode = false;
     $this->bJustAdd = false;
     if (array_key_exists($sTable, self::$dbStructure)) {
         $this->arFields = array_keys(self::$dbStructure[$sTable]);
     } else {
         self::$dbStructure[$sTable] = $this->obDB->GetTableFields($this->sTable);
         $this->arFields = array_keys(self::$dbStructure[$sTable]);
     }
     $this->sKeyField = 'id';
 }