1
0
mirror of synced 2024-12-14 23:26:04 +03:00

Removed onUpdate property on join columns

This commit is contained in:
Michael Ridgway 2011-06-28 15:50:14 -04:00
parent db80b2b135
commit 9ae30421dd
17 changed files with 4 additions and 45 deletions

View File

@ -244,7 +244,6 @@ class AnnotationDriver implements Driver
'unique' => $joinColumnAnnot->unique, 'unique' => $joinColumnAnnot->unique,
'nullable' => $joinColumnAnnot->nullable, 'nullable' => $joinColumnAnnot->nullable,
'onDelete' => $joinColumnAnnot->onDelete, 'onDelete' => $joinColumnAnnot->onDelete,
'onUpdate' => $joinColumnAnnot->onUpdate,
'columnDefinition' => $joinColumnAnnot->columnDefinition, 'columnDefinition' => $joinColumnAnnot->columnDefinition,
); );
} else if ($joinColumnsAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinColumns')) { } else if ($joinColumnsAnnot = $this->_reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\JoinColumns')) {
@ -255,7 +254,6 @@ class AnnotationDriver implements Driver
'unique' => $joinColumn->unique, 'unique' => $joinColumn->unique,
'nullable' => $joinColumn->nullable, 'nullable' => $joinColumn->nullable,
'onDelete' => $joinColumn->onDelete, 'onDelete' => $joinColumn->onDelete,
'onUpdate' => $joinColumn->onUpdate,
'columnDefinition' => $joinColumn->columnDefinition, 'columnDefinition' => $joinColumn->columnDefinition,
); );
} }
@ -363,7 +361,6 @@ class AnnotationDriver implements Driver
'unique' => $joinColumn->unique, 'unique' => $joinColumn->unique,
'nullable' => $joinColumn->nullable, 'nullable' => $joinColumn->nullable,
'onDelete' => $joinColumn->onDelete, 'onDelete' => $joinColumn->onDelete,
'onUpdate' => $joinColumn->onUpdate,
'columnDefinition' => $joinColumn->columnDefinition, 'columnDefinition' => $joinColumn->columnDefinition,
); );
} }
@ -375,7 +372,6 @@ class AnnotationDriver implements Driver
'unique' => $joinColumn->unique, 'unique' => $joinColumn->unique,
'nullable' => $joinColumn->nullable, 'nullable' => $joinColumn->nullable,
'onDelete' => $joinColumn->onDelete, 'onDelete' => $joinColumn->onDelete,
'onUpdate' => $joinColumn->onUpdate,
'columnDefinition' => $joinColumn->columnDefinition, 'columnDefinition' => $joinColumn->columnDefinition,
); );
} }

View File

@ -48,7 +48,6 @@ final class JoinColumn extends Annotation {
public $unique = false; public $unique = false;
public $nullable = true; public $nullable = true;
public $onDelete; public $onDelete;
public $onUpdate;
public $columnDefinition; public $columnDefinition;
} }
final class JoinColumns extends Annotation {} final class JoinColumns extends Annotation {}

View File

@ -471,10 +471,6 @@ class XmlDriver extends AbstractFileDriver
$joinColumn['onDelete'] = (string)$joinColumnElement['on-delete']; $joinColumn['onDelete'] = (string)$joinColumnElement['on-delete'];
} }
if (isset($joinColumnElement['on-update'])) {
$joinColumn['onUpdate'] = (string)$joinColumnElement['on-update'];
}
if (isset($joinColumnElement['column-definition'])) { if (isset($joinColumnElement['column-definition'])) {
$joinColumn['columnDefinition'] = (string)$joinColumnElement['column-definition']; $joinColumn['columnDefinition'] = (string)$joinColumnElement['column-definition'];
} }

View File

@ -490,10 +490,6 @@ class YamlDriver extends AbstractFileDriver
$joinColumn['onDelete'] = $joinColumnElement['onDelete']; $joinColumn['onDelete'] = $joinColumnElement['onDelete'];
} }
if (isset($joinColumnElement['onUpdate'])) {
$joinColumn['onUpdate'] = $joinColumnElement['onUpdate'];
}
if (isset($joinColumnElement['columnDefinition'])) { if (isset($joinColumnElement['columnDefinition'])) {
$joinColumn['columnDefinition'] = $joinColumnElement['columnDefinition']; $joinColumn['columnDefinition'] = $joinColumnElement['columnDefinition'];
} }

View File

@ -248,7 +248,6 @@ class ConvertDoctrine1Schema
'name' => $relation['local'], 'name' => $relation['local'],
'referencedColumnName' => $relation['foreign'], 'referencedColumnName' => $relation['foreign'],
'onDelete' => isset($relation['onDelete']) ? $relation['onDelete'] : null, 'onDelete' => isset($relation['onDelete']) ? $relation['onDelete'] : null,
'onUpdate' => isset($relation['onUpdate']) ? $relation['onUpdate'] : null,
) )
); );
} }

View File

@ -762,10 +762,6 @@ public function <methodName>()
$joinColumnAnnot[] = 'onDelete=' . ($joinColumn['onDelete'] ? 'true' : 'false'); $joinColumnAnnot[] = 'onDelete=' . ($joinColumn['onDelete'] ? 'true' : 'false');
} }
if (isset($joinColumn['onUpdate'])) {
$joinColumnAnnot[] = 'onUpdate=' . ($joinColumn['onUpdate'] ? 'true' : 'false');
}
if (isset($joinColumn['columnDefinition'])) { if (isset($joinColumn['columnDefinition'])) {
$joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"';
} }

View File

@ -215,9 +215,6 @@ class XmlExporter extends AbstractExporter
if (isset($joinColumn['onDelete'])) { if (isset($joinColumn['onDelete'])) {
$joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']);
} }
if (isset($joinColumn['onUpdate'])) {
$joinColumnXml->addAttribute('on-update', $joinColumn['onUpdate']);
}
} }
$inverseJoinColumnsXml = $joinTableXml->addChild('inverse-join-columns'); $inverseJoinColumnsXml = $joinTableXml->addChild('inverse-join-columns');
foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) {
@ -227,9 +224,6 @@ class XmlExporter extends AbstractExporter
if (isset($inverseJoinColumn['onDelete'])) { if (isset($inverseJoinColumn['onDelete'])) {
$inverseJoinColumnXml->addAttribute('on-delete', $inverseJoinColumn['onDelete']); $inverseJoinColumnXml->addAttribute('on-delete', $inverseJoinColumn['onDelete']);
} }
if (isset($inverseJoinColumn['onUpdate'])) {
$inverseJoinColumnXml->addAttribute('on-update', $inverseJoinColumn['onUpdate']);
}
if (isset($inverseJoinColumn['columnDefinition'])) { if (isset($inverseJoinColumn['columnDefinition'])) {
$inverseJoinColumnXml->addAttribute('column-definition', $inverseJoinColumn['columnDefinition']); $inverseJoinColumnXml->addAttribute('column-definition', $inverseJoinColumn['columnDefinition']);
} }
@ -250,9 +244,6 @@ class XmlExporter extends AbstractExporter
if (isset($joinColumn['onDelete'])) { if (isset($joinColumn['onDelete'])) {
$joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']);
} }
if (isset($joinColumn['onUpdate'])) {
$joinColumnXml->addAttribute('on-update', $joinColumn['onUpdate']);
}
if (isset($joinColumn['columnDefinition'])) { if (isset($joinColumn['columnDefinition'])) {
$joinColumnXml->addAttribute('column-definition', $joinColumn['columnDefinition']); $joinColumnXml->addAttribute('column-definition', $joinColumn['columnDefinition']);
} }

View File

@ -154,9 +154,6 @@ class YamlExporter extends AbstractExporter
if (isset($joinColumn['onDelete'])) { if (isset($joinColumn['onDelete'])) {
$newJoinColumns[$joinColumn['name']]['onDelete'] = $joinColumn['onDelete']; $newJoinColumns[$joinColumn['name']]['onDelete'] = $joinColumn['onDelete'];
} }
if (isset($joinColumn['onUpdate'])) {
$newJoinColumns[$joinColumn['name']]['onUpdate'] = $joinColumn['onUpdate'];
}
} }
$oneToOneMappingArray = array( $oneToOneMappingArray = array(
'mappedBy' => $associationMapping['mappedBy'], 'mappedBy' => $associationMapping['mappedBy'],

View File

@ -523,10 +523,6 @@ class SchemaTool
$uniqueConstraints[] = array('columns' => array($columnName)); $uniqueConstraints[] = array('columns' => array($columnName));
} }
if (isset($joinColumn['onUpdate'])) {
$fkOptions['onUpdate'] = $joinColumn['onUpdate'];
}
if (isset($joinColumn['onDelete'])) { if (isset($joinColumn['onDelete'])) {
$fkOptions['onDelete'] = $joinColumn['onDelete']; $fkOptions['onDelete'] = $joinColumn['onDelete'];
} }

View File

@ -42,7 +42,7 @@ class DDC448MainTable
/** /**
* @ManyToOne(targetEntity="DDC448ConnectedClass", cascade={"all"}, fetch="EAGER") * @ManyToOne(targetEntity="DDC448ConnectedClass", cascade={"all"}, fetch="EAGER")
* @JoinColumn(name="connectedClassId", referencedColumnName="id", onDelete="CASCADE", onUpdate="CASCADE", nullable=true) * @JoinColumn(name="connectedClassId", referencedColumnName="id", onDelete="CASCADE", nullable=true)
*/ */
private $connectedClassId; private $connectedClassId;
} }

View File

@ -267,10 +267,9 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
* @depends testColumnDefinition * @depends testColumnDefinition
* @param ClassMetadata $class * @param ClassMetadata $class
*/ */
public function testJoinColumnOnDeleteAndOnUpdate($class) public function testJoinColumnOnDelete($class)
{ {
$this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']); $this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']);
$this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onUpdate']);
return $class; return $class;
} }
@ -324,7 +323,7 @@ class User
/** /**
* @OneToOne(targetEntity="Address", cascade={"remove"}, inversedBy="user") * @OneToOne(targetEntity="Address", cascade={"remove"}, inversedBy="user")
* @JoinColumn(onDelete="CASCADE", onUpdate="CASCADE") * @JoinColumn(onDelete="CASCADE")
*/ */
public $address; public $address;
@ -412,7 +411,6 @@ class User
'name' => 'address_id', 'name' => 'address_id',
'referencedColumnName' => 'id', 'referencedColumnName' => 'id',
'onDelete' => 'CASCADE', 'onDelete' => 'CASCADE',
'onUpdate' => 'CASCADE'
), ),
), ),
'orphanRemoval' => false, 'orphanRemoval' => false,

View File

@ -51,7 +51,6 @@ $metadata->mapOneToOne(array(
'name' => 'address_id', 'name' => 'address_id',
'referencedColumnName' => 'id', 'referencedColumnName' => 'id',
'onDelete' => 'CASCADE', 'onDelete' => 'CASCADE',
'onUpdate' => 'CASCADE'
), ),
), ),
'orphanRemoval' => false, 'orphanRemoval' => false,

View File

@ -30,7 +30,6 @@ Doctrine\Tests\ORM\Mapping\User:
name: address_id name: address_id
referencedColumnName: id referencedColumnName: id
onDelete: CASCADE onDelete: CASCADE
onUpdate: CASCADE
cascade: [ remove ] cascade: [ remove ]
oneToMany: oneToMany:
phonenumbers: phonenumbers:

View File

@ -217,7 +217,6 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
$this->assertEquals('address_id', $class->associationMappings['address']['joinColumns'][0]['name']); $this->assertEquals('address_id', $class->associationMappings['address']['joinColumns'][0]['name']);
$this->assertEquals('id', $class->associationMappings['address']['joinColumns'][0]['referencedColumnName']); $this->assertEquals('id', $class->associationMappings['address']['joinColumns'][0]['referencedColumnName']);
$this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']); $this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onDelete']);
$this->assertEquals('CASCADE', $class->associationMappings['address']['joinColumns'][0]['onUpdate']);
$this->assertTrue($class->associationMappings['address']['isCascadeRemove']); $this->assertTrue($class->associationMappings['address']['isCascadeRemove']);
$this->assertFalse($class->associationMappings['address']['isCascadePersist']); $this->assertFalse($class->associationMappings['address']['isCascadePersist']);

View File

@ -24,7 +24,7 @@ class User
/** /**
* @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\Export\Address", cascade={"remove"}, inversedBy="user") * @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\Export\Address", cascade={"remove"}, inversedBy="user")
* @JoinColumn(name="address_id", onDelete="CASCADE", onUpdate="CASCADE") * @JoinColumn(name="address_id", onDelete="CASCADE")
*/ */
public $address; public $address;

View File

@ -47,7 +47,6 @@ $metadata->mapOneToOne(array(
'name' => 'address_id', 'name' => 'address_id',
'referencedColumnName' => 'id', 'referencedColumnName' => 'id',
'onDelete' => 'CASCADE', 'onDelete' => 'CASCADE',
'onUpdate' => 'CASCADE'
), ),
), ),
'orphanRemoval' => false, 'orphanRemoval' => false,

View File

@ -24,6 +24,5 @@ Profile:
relations: relations:
User: User:
onDelete: CASCADE onDelete: CASCADE
onUpdate: CASCADE
foreignType: one foreignType: one
type: one type: one