PHP Method Schema::db, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::db from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples
Frequently Used Methods
Example #1
Show file File: ForeignKeyTest.php Project: cebe/chive
0
 /**
  * Setup test databases.
  */
 protected function setUp()
 {
     $this->executeSqlFile('models/ForeignKeyTest.sql');
     Column::$db = ForeignKey::$db = Index::$db = Routine::$db = Row::$db = Schema::$db = Table::$db = Trigger::$db = View::$db = $this->createDbConnection('tabletest');
 }
Example #2
Show file File: SchemaTest.php Project: cebe/chive
0
 protected function setUp()
 {
     $this->executeSqlFile('models/SchemaTest.sql');
     Schema::$db = $this->createDbConnection('information_schema');
 }
Example #3
Show file File: SchemaController.php Project: cebe/chive
0
 /**
  * Drop a schema.
  */
 public function actionDrop()
 {
     $response = new AjaxResponse();
     $response->refresh = true;
     $response->executeJavaScript('sideBar.loadSchemata()');
     $schemata = (array) $_POST['schemata'];
     $droppedSchemata = $droppedSqls = array();
     Schema::$db = Yii::app()->getDb();
     foreach ($schemata as $schema) {
         $schemaObj = Schema::model()->findByPk($schema);
         $schemaObj->throwExceptions = true;
         try {
             $sql = $schemaObj->delete();
             $droppedSchemata[] = $schema;
             $droppedSqls[] = $sql;
         } catch (DbException $ex) {
             $response->addNotification('error', Yii::t('core', 'errorDropSchema', array('{schema}' => $schema)), $ex->getText(), $ex->getSql());
         }
     }
     $count = count($droppedSchemata);
     if ($count > 0) {
         $response->addNotification('success', Yii::t('core', 'successDropSchema', array($count, '{schema}' => $droppedSchemata[0], '{schemaCount}' => $count)), $count > 1 ? implode(', ', $droppedSchemata) : null, implode("\n", $droppedSqls));
     }
     $this->sendJSON($response);
 }