Changeset 4300
- Timestamp:
- 04/30/08 04:51:58 (14 months ago)
- Location:
- branches/0.11
- Files:
-
- 6 modified
-
lib/Doctrine/Export/Mysql.php (modified) (1 diff)
-
lib/Doctrine/Record.php (modified) (1 diff)
-
lib/Doctrine/Relation/Parser.php (modified) (2 diffs)
-
lib/Doctrine/Table.php (modified) (2 diffs)
-
tests/models/Element.php (modified) (1 diff)
-
tests/models/Error.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Export/Mysql.php
r4252 r4300 99 99 } 100 100 $queryFields = $this->getFieldDeclarationList($fields); 101 101 102 102 // build indexes for all foreign key fields (needed in MySQL!!) 103 103 if (isset($options['foreignKeys'])) { -
branches/0.11/lib/Doctrine/Record.php
r4265 r4300 724 724 /** 725 725 * refresh 726 * refres data of related objects from the database726 * refresh data of related objects from the database 727 727 * 728 728 * @param string $name name of a related component. -
branches/0.11/lib/Doctrine/Relation/Parser.php
r4211 r4300 105 105 } 106 106 107 /* looks like old code?108 $lower = strtolower($name);109 if ($this->_table->hasColumn($lower)) {110 throw new Doctrine_Relation_Exception("Couldn't bind relation. Column with name " . $lower . ' already exists!');111 }112 */113 114 107 $e = explode(' as ', $name); 115 108 $name = $e[0]; … … 121 114 122 115 $this->_pending[$alias] = array_merge($options, array('class' => $name, 'alias' => $alias)); 123 /**124 $m = Doctrine_Manager::getInstance();125 126 if (isset($options['onDelete'])) {127 $m->addDeleteAction($name, $this->_table->getComponentName(), $options['onDelete']);128 }129 if (isset($options['onUpdate'])) {130 $m->addUpdateAction($name, $this->_table->getComponentName(), $options['onUpdate']);131 }132 */133 116 134 117 return $this->_pending[$alias]; -
branches/0.11/lib/Doctrine/Table.php
r4290 r4300 786 786 $classes = array_merge($this->_options['parents'], array($this->getComponentName())); 787 787 788 789 788 $e = explode('.', $args[1]); 790 789 if (in_array($e[0], $classes)) { … … 804 803 805 804 $options = array_merge($args[2], $options); 806 807 $this->_parser->bind($args[0], $options);808 805 } else { 809 806 $options = array_merge($args[1], $options); 810 $this->_parser->bind($args[0], $options); 811 } 807 } 808 809 $this->_parser->bind($args[0], $options); 812 810 } 813 811 -
branches/0.11/tests/models/Element.php
r2353 r4300 6 6 } 7 7 public function setUp() { 8 $this->hasMany('Element as Child', 'Child.parent_id'); 9 $this->hasOne('Element as Parent', 'Element.parent_id'); 8 $this->hasMany('Element as Child', array('local' => 'id', 9 'foreign' => 'parent_id')); 10 $this->hasOne('Element as Parent', array('local' => 'parent_id', 11 'foreign' => 'id')); 10 12 } 11 13 } -
branches/0.11/tests/models/Error.php
r2353 r4300 2 2 class Error extends Doctrine_Record { 3 3 public function setUp() { 4 $this->ownsMany('Description', 'Description.file_md5', 'file_md5'); 4 $this->hasMany('Description', array('local' => 'file_md5', 5 'foreign' => 'file_md5')); 5 6 } 6 7 public function setTableDefinition() {