protected function loadControls() { // Загружаем контролы $sql = 'select * from `%s` WHERE `schemaId`="%s" ORDER by `order` ASC'; $sql = sprintf($sql, CCONFIG_CONTROL_TABLE, $this->id); $data = DB::query($sql); // Конвертируем в объекты $result = array(); foreach ($data as $row) { $result[] = CConfigControlManager::createControl($row['id'], $row['name'], $row['xtype'], $row['title'], $row['config'], $row['value'], $this); } $this->controls = $result; }
/** * Создаем контрол */ public function testCreateControl() { $control = CConfigControlManager::createControl('2', 'test', 'inputField', 'XX', array(), '1', null); $this->assertEquals(true, $control instanceof CConfigBaseControl); }