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

This page contains top rated real world PHP examples of method Schema::getDatabases 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: CoughGenerator.class.php Project: jmhobbs/MkLst
0
 /**
  * Generates Cough classes from a Schema object.
  * 
  * @param Schema $schema
  * @return void
  * @author Anthony Bush
  **/
 public function generateCoughClassesFromSchema(Schema $schema)
 {
     foreach ($schema->getDatabases() as $database) {
         foreach ($database->getTables() as $table) {
             $this->generateCoughClassesFromSchemaTable($table);
         }
     }
 }
Example #2
Show file File: SchemaManipulator.class.php Project: jmhobbs/MkLst
0
 /**
  * Scans the schema for the specified table name (or prefix + table name),
  * starting with the given database and only scanning other databases if
  * the table is not found there.
  *
  * @return mixed - SchemaTable if found, null if not
  * @author Anthony Bush
  **/
 protected function findTable($tableNameMatch, SchemaTable $sourceTable)
 {
     $firstDatabase = $sourceTable->getDatabase();
     $table = $this->findTableInDatabase($tableNameMatch, $firstDatabase);
     if (is_null($table)) {
         // Try again for every other database
         $firstDatabaseName = $firstDatabase->getDatabaseName();
         foreach ($this->schema->getDatabases() as $dbName => $database) {
             if ($dbName == $firstDatabaseName || !$this->config->shouldScanForJoin($sourceTable, $database)) {
                 continue;
             }
             $table = $this->findTableInDatabase($tableNameMatch, $database);
             if (!is_null($table)) {
                 break;
             }
         }
     }
     return $table;
 }