Changeset 8112
- Timestamp:
- 03/27/08 13:47:34 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php
r7892 r8112 95 95 { 96 96 // create a new entry in the database 97 if (!class_exists($class)) 98 { 99 throw new InvalidArgumentException(sprintf('Unknown class "%s".', $class)); 100 } 101 97 102 $obj = new $class(); 98 103 99 104 if (!$obj instanceof BaseObject) 100 105 { 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));106 throw new RuntimeException(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)); 102 107 } 103 108 104 109 if (!is_array($data)) 105 110 { 106 throw new Exception(sprintf('You must give a name for each fixture data entry (class %s)', $class));111 throw new InvalidArgumentException(sprintf('You must give a name for each fixture data entry (class %s).', $class)); 107 112 } 108 113 … … 136 141 if (!isset($this->object_references[$relatedTable->getPhpName().'_'.$value])) 137 142 { 138 throw new sfException(sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedTable->getPhpName()));143 throw new InvalidArgumentException(sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedTable->getPhpName())); 139 144 } 140 145 $value = $this->object_references[$relatedTable->getPhpName().'_'.$value]->getPrimaryKey(); … … 152 157 else 153 158 { 154 throw new sfException(sprintf('Column "%s" does not exist for class "%s"', $name, $class));159 throw new InvalidArgumentException(sprintf('Column "%s" does not exist for class "%s".', $name, $class)); 155 160 } 156 161 } … … 188 193 if (!isset($relatedClass)) 189 194 { 190 throw new sfException(sprintf('Unable to find the many-to-many relationship for object "%s"', get_class($obj)));195 throw new InvalidArgumentException(sprintf('Unable to find the many-to-many relationship for object "%s".', get_class($obj))); 191 196 } 192 197 … … 198 203 if (!isset($this->object_references[$relatedClass.'_'.$value])) 199 204 { 200 throw new sfException(sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedClass));205 throw new InvalidArgumentException(sprintf('The object "%s" from class "%s" is not defined in your data file.', $value, $relatedClass)); 201 206 } 202 207 … … 244 249 { 245 250 continue; 251 } 252 253 // Check that peer class exists before calling doDeleteAll() 254 if (!class_exists($class.'Peer')) 255 { 256 throw new InvalidArgumentException(sprintf('Unknown class "%sPeer".', $class)); 246 257 } 247 258