Changeset 5843
- Timestamp:
- 11/04/07 16:21:15 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/addon/propel/sfPropelData.class.php
r5339 r5843 99 99 $obj = new $class(); 100 100 101 if (!$obj instanceof BaseObject) 102 { 103 throw new Exception(sprintf('The class "%s" is not a Propel class. This probably means there is already a class named "%s" somewhere in symfony or in your project.', $class, $class)); 104 } 105 101 106 if (!is_array($data)) 102 107 { 103 throw new Exception(sprintf('You must give a name for each fixture data entry (class %s)' ), $class);108 throw new Exception(sprintf('You must give a name for each fixture data entry (class %s)', $class)); 104 109 } 105 110 … … 126 131 } 127 132 128 $pos = array_search($name, $column_names); 129 $method = 'set'.sfInflector::camelize($name); 130 if ($pos) 133 if (false !== $pos = array_search($name, $column_names)) 131 134 { 132 135 $obj->setByPosition($pos, $value); 133 136 } 134 else if (is_callable(array($obj, $method )))137 else if (is_callable(array($obj, $method = 'set'.sfInflector::camelize($name)))) 135 138 { 136 139 $obj->$method($value);

