Changeset 5839
- Timestamp:
- 11/04/07 15:22:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php
r5340 r5839 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 … … 124 129 } 125 130 126 $pos = array_search($name, $column_names); 127 $method = 'set'.sfInflector::camelize($name); 128 if ($pos) 131 if (false !== $pos = array_search($name, $column_names)) 129 132 { 130 133 $obj->setByPosition($pos, $value); 131 134 } 132 else if (is_callable(array($obj, $method )))135 else if (is_callable(array($obj, $method = 'set'.sfInflector::camelize($name)))) 133 136 { 134 137 $obj->$method($value);

