当前位置: 首页>>代码示例>>PHP>>正文


PHP Collation::model方法代码示例

本文整理汇总了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);
 }
开发者ID:cebe,项目名称:chive,代码行数:17,代码来源:CollationTest.php

示例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));
 }
开发者ID:cebe,项目名称:chive,代码行数:20,代码来源:TableController.php

示例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));
 }
开发者ID:cebe,项目名称:chive,代码行数:19,代码来源:SchemaController.php

示例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);
 }
开发者ID:cebe,项目名称:chive,代码行数:18,代码来源:ColumnController.php


注:本文中的Collation::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。