Convention fixes
This commit is contained in:
parent
06eed4cfda
commit
df82b6060b
@ -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'];
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user