Exemplo n.º 1
0
 public function shouldGenerateLoadSqlInnerJoins(SchemaTable $table)
 {
     $dbName = $table->getDatabase()->getDatabaseName();
     $tableName = $table->getTableName();
     $option = $this->getConfigValue('load_sql_inner_joins', $dbName, $tableName);
     if ($option == 'enabled') {
         return true;
     } else {
         return false;
     }
 }
 /**
  * Returns whether or not a the $sourceTable cares about the $refDatabase when looking
  * for joins.
  * 
  * @param SchemaTable $sourceTable - the source table that is trying to link up related joins
  * @param SchemaDatabase $refDatabase - the dest database to scan if shouldScanForJoin() returns true
  * @return boolean
  * @author Anthony Bush
  * @since 2007-11-06
  **/
 public function shouldScanForJoin(SchemaTable $sourceTable, SchemaDatabase $refDatabase)
 {
     $dbName = $sourceTable->getDatabase()->getDatabaseName();
     $tableName = $sourceTable->getTableName();
     $option = $this->getConfigValue('acceptable_join_databases', $dbName, $tableName);
     if (is_array($option)) {
         // yes, but only for databases in the array.
         $refDbName = $refDatabase->getDatabaseName();
         if (in_array($refDbName, $option)) {
             return true;
         }
     } else {
         if ($option == 'all') {
             return true;
         }
     }
     return false;
 }