Changeset 4502

Show
Ignore:
Timestamp:
06/08/08 23:26:30 (13 months ago)
Author:
jwage
Message:

fixes #1044

Location:
branches/0.11
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Import/Schema.php

    r4475 r4502  
    117117                                                          'onUpdate', 
    118118                                                          'equal', 
    119                                                           'override', 
    120119                                                          'owningSide'), 
    121120 
  • branches/0.11/lib/Doctrine/Relation.php

    r4472 r4502  
    8080                                  'cascade'     => array(), // application-level cascades 
    8181                                  'owningSide'  => false, // whether this is the owning side 
    82                                   'override'    => false // whether to override if relation exists already 
    8382                                  ); 
    8483 
  • branches/0.11/lib/Doctrine/Relation/Parser.php

    r4472 r4502  
    136136        } 
    137137 
    138         if ($this->hasRelation($alias) && (! isset($options['override']) || ! $options['override'])) { 
    139             throw new Doctrine_Relation_Exception('A relationship with the name "' . $alias . '" already exists.'); 
    140         } 
    141  
    142         if (isset($this->relations[$alias])) {  
    143                     unset($this->relations[$alias]);  
    144         } 
    145  
    146         if (isset($this->_pending[$alias])) {  
    147                     unset($this->_pending[$alias]);  
    148         }  
     138        if ($this->hasRelation($alias)) { 
     139            unset($this->relations[$alias]); 
     140            unset($this->_pending[$alias]); 
     141        } 
    149142 
    150143        $this->_pending[$alias] = array_merge($options, array('class' => $name, 'alias' => $alias)); 
  • branches/0.11/manual/docs/en/relations.txt

    r4472 r4502  
    1414* **onDelete**, (optional) the onDelete integrity action that is applied on the foreign key constraint when the tables are created by Doctrine. 
    1515* **onUpdate**, (optional) the onUpdate integrity action that is applied on the foreign key constraint when the tables are created by Doctrine. 
    16 * **override**, (optional) the override option will override the relation definition if one already exists with the same name. This is useful in cases where you have child classes using inheritance which redefine a relations information for the child class. 
    1716 
    1817So lets take our first example, say we have two classes Forum_Board and Forum_Thread. Here Forum_Board has many  
  • branches/0.11/tests/run.php

    r4486 r4502  
    7373$tickets->addTestCase(new Doctrine_Ticket_1071_TestCase()); 
    7474$tickets->addTestCase(new Doctrine_Ticket_1072_TestCase()); 
     75$tickets->addTestCase(new Doctrine_Ticket_1092_TestCase()); 
    7576$tickets->addTestCase(new Doctrine_Ticket_1099_TestCase()); 
    7677$tickets->addTestCase(new Doctrine_Ticket_1113_TestCase());