Ticket #3210: propel_load_data.patch
| File propel_load_data.patch, 1.7 kB (added by trivoallan, 10 months ago) |
|---|
-
lib/symfony/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php
old new 94 94 foreach ($datas as $key => $data) 95 95 { 96 96 // create a new entry in the database 97 $obj = new $class(); 97 $classname = ucfirst($class); 98 if (!class_exists($classname)) 99 { 100 throw new sfException(sprintf('Unknown class "%s".')); 101 } 102 103 $obj = new $classname(); 98 104 99 105 if (!$obj instanceof BaseObject) 100 106 { 101 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));107 throw new sfException(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.', $classname, $classname)); 102 108 } 103 109 104 110 if (!is_array($data)) … … 245 251 continue; 246 252 } 247 253 248 call_user_func(array($class.'Peer', 'doDeleteAll'), $this->con); 254 // Check that peer class exists before calling doDeleteAll() 255 $peer_classname = ucfirst($class.'Peer'); 256 if (!class_exists($peer_classname)) 257 { 258 throw new sfException(sprintf('Unknown class "%s".', $peer_classname)); 259 } 260 261 call_user_func(array($peer_classname, 'doDeleteAll'), $this->con); 249 262 250 263 $this->deletedClasses[] = $class; 251 264 }