Changeset 4300

Show
Ignore:
Timestamp:
04/30/08 04:51:58 (14 months ago)
Author:
jwage
Message:

Cleanup

Location:
branches/0.11
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Export/Mysql.php

    r4252 r4300  
    9999        } 
    100100        $queryFields = $this->getFieldDeclarationList($fields); 
    101          
     101 
    102102        // build indexes for all foreign key fields (needed in MySQL!!) 
    103103        if (isset($options['foreignKeys'])) { 
  • branches/0.11/lib/Doctrine/Record.php

    r4265 r4300  
    724724    /** 
    725725     * refresh 
    726      * refres data of related objects from the database 
     726     * refresh data of related objects from the database 
    727727     * 
    728728     * @param string $name              name of a related component. 
  • branches/0.11/lib/Doctrine/Relation/Parser.php

    r4211 r4300  
    105105        } 
    106106 
    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  
    114107        $e    = explode(' as ', $name); 
    115108        $name = $e[0]; 
     
    121114 
    122115        $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         */ 
    133116 
    134117        return $this->_pending[$alias]; 
  • branches/0.11/lib/Doctrine/Table.php

    r4290 r4300  
    786786            $classes = array_merge($this->_options['parents'], array($this->getComponentName())); 
    787787 
    788  
    789788            $e = explode('.', $args[1]); 
    790789            if (in_array($e[0], $classes)) { 
     
    804803 
    805804            $options = array_merge($args[2], $options); 
    806  
    807             $this->_parser->bind($args[0], $options); 
    808805        } else { 
    809806            $options = array_merge($args[1], $options); 
    810             $this->_parser->bind($args[0], $options); 
    811         } 
     807        } 
     808 
     809        $this->_parser->bind($args[0], $options); 
    812810    } 
    813811 
  • branches/0.11/tests/models/Element.php

    r2353 r4300  
    66    } 
    77    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')); 
    1012    } 
    1113} 
  • branches/0.11/tests/models/Error.php

    r2353 r4300  
    22class Error extends Doctrine_Record { 
    33    public function setUp() { 
    4         $this->ownsMany('Description', 'Description.file_md5', 'file_md5'); 
     4        $this->hasMany('Description', array('local'   => 'file_md5', 
     5                                            'foreign' => 'file_md5')); 
    56    } 
    67    public function setTableDefinition() {