Changeset 1893
- Timestamp:
- 01/31/2008 03:38:02 PM (11 months ago)
- Location:
- trunk/system
- Files:
-
- 3 modified
-
config/email.php (modified) (3 props)
-
helpers/email.php (modified) (1 diff, 3 props)
-
libraries/ORM.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/config/email.php
- Property svn:eol-style set to LF
- Property copyright set to Copyright (c) 2008 Kohana Team
- Property svn:keywords set to Id
-
trunk/system/helpers/email.php
- Property svn:eol-style set to LF
- Property copyright set to Copyright (c) 2008 Kohana Team
- Property svn:keywords set to Id
r1892 r1893 3 3 * Email helper class. 4 4 * 5 * $Id : valid.php 1865 2008-01-29 19:48:29Z Geert$5 * $Id$ 6 6 * 7 7 * @package Validation -
trunk/system/libraries/ORM.php
r1877 r1893 133 133 return $this->object->$key; 134 134 } 135 elseif ( ! empty($this->object->id) AND in_array($key, $this->has_one))135 elseif ( ! empty($this->object->id) AND (in_array($key, $this->has_one) OR in_array($key, $this->belongs_to))) 136 136 { 137 137 // Set the model name 138 138 $model = ucfirst($key).'_Model'; 139 139 140 // Set the foreign key name 141 $id = $key.'_id'; 142 143 if (isset($this->object->$id)) 144 { 145 return $this->object->$key = new $model($this->object->$id); 140 // Set the child id name 141 $child_id = $key.'_id'; 142 143 if (isset($this->object->$child_id)) 144 { 145 // Get the foreign object using the key defined in this object 146 return $this->object->$key = new $model($this->object->$child_id); 146 147 } 147 148 else 148 149 { 149 // Set the foriegn key to this primary key 150 $id = $this->class.'_id'; 151 150 // Get the foreign object using the primary key of this object 152 151 return $this->object->$key = new $model(array($this->class.'_id', $this->object->id)); 153 152 }
