1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Convention fixes

This commit is contained in:
Rivaros 2012-02-13 15:05:28 +02:00 committed by Benjamin Eberlei
parent 06eed4cfda
commit df82b6060b
3 changed files with 10 additions and 14 deletions

View File

@ -1224,8 +1224,9 @@ class ClassMetadataInfo implements ClassMetadata
foreach ($mapping['joinColumns'] as $key => &$joinColumn) {
if ($mapping['type'] === self::ONE_TO_ONE && ! $this->isInheritanceTypeSingleTable()) {
if (count($mapping['joinColumns']) == 1) {
if(! isset($mapping['id']) || ! $mapping['id'])
if (! isset($mapping['id']) || ! $mapping['id']) {
$joinColumn['unique'] = true;
}
} else {
$uniqueContraintColumns[] = $joinColumn['name'];
}

View File

@ -300,10 +300,9 @@ class DatabaseDriver implements Driver
$associationMapping['fieldName'] = $this->getFieldNameForColumn($tableName, $localColumn, true);
$associationMapping['targetEntity'] = $this->getClassNameForTable($foreignTable);
if ($primaryKeyColumns && in_array($localColumn, $primaryKeyColumns))
{
$associationMapping['id'] = true;
}
if ($primaryKeyColumns && in_array($localColumn, $primaryKeyColumns)) {
$associationMapping['id'] = true;
}
for ($i = 0; $i < count($cols); $i++) {
$associationMapping['joinColumns'][] = array(
@ -312,15 +311,13 @@ class DatabaseDriver implements Driver
);
}
//Here we need to check if $cols are the same as $primaryKeyColums
if(!array_diff($cols,$primaryKeyColumns))
if(!array_diff($cols,$primaryKeyColumns)) {
$metadata->mapOneToOne($associationMapping);
else
}
else {
$metadata->mapManyToOne($associationMapping);
}
}
}

View File

@ -894,10 +894,8 @@ public function <methodName>()
$lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'Id';
if ($generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
$lines[] = $this->_spaces.' * @' . $this->_annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
$lines[] = $this->_spaces . ' * @' . $this->_annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
}
}
$type = null;