1
0
mirror of synced 2024-12-13 06:46:03 +03:00

[2.0] Fixed more STRICT standards notices (only variables should be passed by reference...). @beberlei, error_reporting=E_ALL | E_STRICT

This commit is contained in:
romanb 2009-12-07 13:04:54 +00:00
parent 1013eb66c1
commit 5730a32d91
2 changed files with 7 additions and 4 deletions

View File

@ -132,14 +132,16 @@ class DatabaseDriver implements Driver
"Cannot generate mapping for table '".$tableName."' with foreign keys with multiple local columns." "Cannot generate mapping for table '".$tableName."' with foreign keys with multiple local columns."
); );
} }
$localColumn = current($foreignKey->getColumns()); $cols = $foreignKey->getColumns();
$localColumn = current($cols);
if (count($foreignKey->getForeignColumns()) != 1) { $fkCols = $foreignKey->getForeignColumns();
if (count($fkCols) != 1) {
throw new MappingException( throw new MappingException(
"Cannot generate mapping for table '".$tableName."' with foreign keys with multiple foreign columns." "Cannot generate mapping for table '".$tableName."' with foreign keys with multiple foreign columns."
); );
} }
$foreignColumn = current($foreignKey->getForeignColumns()); $foreignColumn = current($fkCols);
$associationMapping = array(); $associationMapping = array();
$associationMapping['fieldName'] = Inflector::camelize(str_ireplace('_id', '', $localColumn)); $associationMapping['fieldName'] = Inflector::camelize(str_ireplace('_id', '', $localColumn));

View File

@ -346,7 +346,8 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertFalse($table->hasIndex('foo_idx')); $this->assertFalse($table->hasIndex('foo_idx'));
$this->assertEquals(1, count($table->getForeignKeys())); $this->assertEquals(1, count($table->getForeignKeys()));
$foreignKey = current($table->getForeignKeys()); $fks = $table->getForeignKeys();
$foreignKey = current($fks);
$this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName())); $this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName()));
$this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns())); $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns()));
$this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns())); $this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns()));