Changeset 8937
- Timestamp:
- 05/14/08 03:48:32 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfDoctrinePlugin/trunk/lib/sfFormDoctrine.class.php
r8743 r8937 30 30 { 31 31 protected 32 $isNew = true,33 32 $cultures = array(), 34 33 $object = null; … … 58 57 59 58 $this->object = $object; 60 $this->isNew = $this->object->exists();61 59 } 62 60 … … 88 86 public function isNew() 89 87 { 90 return $this->object->exists();88 return !$this->object->exists(); 91 89 } 92 90 … … 307 305 { 308 306 // update defaults for the main object 309 if ($this->isNew )307 if ($this->isNew()) 310 308 { 311 309 $this->setDefaults(array_merge($this->object->toArray(BasePeer::TYPE_FIELDNAME), $this->getDefaults())); … … 322 320 foreach ($this->cultures as $culture) 323 321 { 324 if ($this->isNew )322 if ($this->isNew()) 325 323 { 326 324 $this->setDefault($culture, array_merge($this->object->$method($culture)->toArray(BasePeer::TYPE_FIELDNAME), $this->getDefault($culture)));