本文整理汇总了PHP中Collation::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Collation::model方法的具体用法?PHP Collation::model怎么用?PHP Collation::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collation
的用法示例。
在下文中一共展示了Collation::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoad
/**
* Load collation with properties and relations.
*/
public function testLoad()
{
// Load collation
$col = Collation::model()->findByPk('utf8_general_ci');
// Assert properties
$this->assertEquals('utf8_general_ci', $col->COLLATION_NAME);
$this->assertEquals('utf8', $col->CHARACTER_SET_NAME);
$this->assertEquals(33, $col->ID);
$this->assertEquals('Yes', $col->IS_DEFAULT);
$this->assertEquals('Yes', $col->IS_COMPILED);
$this->assertEquals(1, $col->SORTLEN);
// Assert character set
$this->assertType('CharacterSet', $col->characterSet);
}
示例2: actionUpdate
/**
* Updates a table.
*/
public function actionUpdate()
{
$this->layout = false;
$isSubmitted = false;
$sql = false;
$table = Table::model()->findByPk(array('TABLE_SCHEMA' => $this->schema, 'TABLE_NAME' => $this->table));
if (isset($_POST['Table'])) {
$table->attributes = $_POST['Table'];
$sql = $table->save();
if ($sql) {
$isSubmitted = true;
}
}
$collations = Collation::model()->findAll(array('order' => 'COLLATION_NAME', 'select' => 'COLLATION_NAME, CHARACTER_SET_NAME AS collationGroup'));
CHtml::generateRandomIdPrefix();
$this->render('form', array('table' => $table, 'collations' => $collations, 'storageEngines' => StorageEngine::getSupportedEngines(), 'isSubmitted' => $isSubmitted, 'sql' => $sql));
}
示例3: actionUpdate
/**
* Update a schema.
*
* @todo(mburtscher): Renaming. Requires copying the whole schema.
*/
public function actionUpdate()
{
$isSubmitted = false;
$sql = null;
$schema = $this->loadSchema();
if (isset($_POST['Schema'])) {
$schema->attributes = $_POST['Schema'];
if ($sql = $schema->save()) {
$isSubmitted = true;
}
}
$collations = Collation::model()->findAll(array('order' => 'COLLATION_NAME', 'select' => 'COLLATION_NAME, CHARACTER_SET_NAME AS collationGroup'));
$this->render('form', array('schema' => $schema, 'collations' => $collations, 'isSubmitted' => $isSubmitted, 'sql' => $sql));
}
示例4: actionUpdate
public function actionUpdate()
{
$isSubmitted = false;
$sql = false;
$column = Column::model()->findByPk(array('TABLE_SCHEMA' => $this->schema, 'TABLE_NAME' => $this->table, 'COLUMN_NAME' => $this->column));
if (isset($_POST['Column'])) {
$column->attributes = $_POST['Column'];
$sql = $column->save();
if ($sql) {
$isSubmitted = true;
}
}
$collations = Collation::model()->findAll(array('order' => 'COLLATION_NAME', 'select' => 'COLLATION_NAME, CHARACTER_SET_NAME AS collationGroup'));
CHtml::generateRandomIdPrefix();
$data = array('column' => $column, 'collations' => $collations, 'isSubmitted' => $isSubmitted, 'sql' => $sql);
$data['formBody'] = $this->renderPartial('formBody', $data, true);
$this->render('form', $data);
}