Changeset 989
- Timestamp:
- 06/15/08 15:38:45 (6 months ago)
- Files:
-
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (4 diffs)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (4 diffs)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (4 diffs)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (4 diffs)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r891 r989 254 254 255 255 } 256 256 257 /** 258 * overload this method if you wan to do additionnal things on the dao generated by the 259 * jFormsBase::prepareDaoFromControls method 260 * @param jFormsBase $form the form 261 * @param jDaoRecordBase $form_daorec 262 */ 263 protected function _beforeSaveCreate($form, $form_daorec) { 264 265 } 266 257 267 /** 258 268 * save data of a form in a new record … … 267 277 268 278 if($form->check() && $this->_checkData($form, false)){ 269 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 279 extract($form->prepareDaoFromControls($this->dao,null,$this->dbProfil), 280 EXTR_PREFIX_ALL, "form"); 281 $this->_beforeSaveCreate($form, $form_daorec); 282 $form_dao->insert($form_daorec); 283 $id = $form_daorec->getPk(); 270 284 $form->saveAllFiles($this->uploadsDirectory); 271 285 $rep->action = $this->_getAction('view'); … … 354 368 355 369 } 370 371 /** 372 * overload this method if you wan to do additionnal things on the dao generated by the 373 * jFormsBase::prepareDaoFromControls method 374 * @param jFormsBase $form the form 375 * @param jDaoRecordBase $form_daorec 376 * @param mixed $id the new id of the updated record 377 */ 378 protected function _beforeSaveUpdate($form, $form_daorec, $id) { 379 380 } 356 381 357 382 /** … … 368 393 369 394 if($form->check() && $this->_checkData($form, true)){ 370 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 395 extract($form->prepareDaoFromControls($this->dao,$id,$this->dbProfil), 396 EXTR_PREFIX_ALL, "form"); 397 $this->_beforeSaveUpdate($form, $form_daorec, $id); 398 $form_dao->update($form_daorec); 371 399 $form->saveAllFiles($this->uploadsDirectory); 372 400 $rep->action = $this->_getAction('view'); trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r891 r989 254 254 255 255 } 256 256 257 /** 258 * overload this method if you wan to do additionnal things on the dao generated by the 259 * jFormsBase::prepareDaoFromControls method 260 * @param jFormsBase $form the form 261 * @param jDaoRecordBase $form_daorec 262 */ 263 protected function _beforeSaveCreate($form, $form_daorec) { 264 265 } 266 257 267 /** 258 268 * save data of a form in a new record … … 267 277 268 278 if($form->check() && $this->_checkData($form, false)){ 269 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 279 extract($form->prepareDaoFromControls($this->dao,null,$this->dbProfil), 280 EXTR_PREFIX_ALL, "form"); 281 $this->_beforeSaveCreate($form, $form_daorec); 282 $form_dao->insert($form_daorec); 283 $id = $form_daorec->getPk(); 270 284 $form->saveAllFiles($this->uploadsDirectory); 271 285 $rep->action = $this->_getAction('view'); … … 354 368 355 369 } 370 371 /** 372 * overload this method if you wan to do additionnal things on the dao generated by the 373 * jFormsBase::prepareDaoFromControls method 374 * @param jFormsBase $form the form 375 * @param jDaoRecordBase $form_daorec 376 * @param mixed $id the new id of the updated record 377 */ 378 protected function _beforeSaveUpdate($form, $form_daorec, $id) { 379 380 } 356 381 357 382 /** … … 368 393 369 394 if($form->check() && $this->_checkData($form, true)){ 370 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 395 extract($form->prepareDaoFromControls($this->dao,$id,$this->dbProfil), 396 EXTR_PREFIX_ALL, "form"); 397 $this->_beforeSaveUpdate($form, $form_daorec, $id); 398 $form_dao->update($form_daorec); 371 399 $form->saveAllFiles($this->uploadsDirectory); 372 400 $rep->action = $this->_getAction('view'); trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r891 r989 254 254 255 255 } 256 256 257 /** 258 * overload this method if you wan to do additionnal things on the dao generated by the 259 * jFormsBase::prepareDaoFromControls method 260 * @param jFormsBase $form the form 261 * @param jDaoRecordBase $form_daorec 262 */ 263 protected function _beforeSaveCreate($form, $form_daorec) { 264 265 } 266 257 267 /** 258 268 * save data of a form in a new record … … 267 277 268 278 if($form->check() && $this->_checkData($form, false)){ 269 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 279 extract($form->prepareDaoFromControls($this->dao,null,$this->dbProfil), 280 EXTR_PREFIX_ALL, "form"); 281 $this->_beforeSaveCreate($form, $form_daorec); 282 $form_dao->insert($form_daorec); 283 $id = $form_daorec->getPk(); 270 284 $form->saveAllFiles($this->uploadsDirectory); 271 285 $rep->action = $this->_getAction('view'); … … 354 368 355 369 } 370 371 /** 372 * overload this method if you wan to do additionnal things on the dao generated by the 373 * jFormsBase::prepareDaoFromControls method 374 * @param jFormsBase $form the form 375 * @param jDaoRecordBase $form_daorec 376 * @param mixed $id the new id of the updated record 377 */ 378 protected function _beforeSaveUpdate($form, $form_daorec, $id) { 379 380 } 356 381 357 382 /** … … 368 393 369 394 if($form->check() && $this->_checkData($form, true)){ 370 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 395 extract($form->prepareDaoFromControls($this->dao,$id,$this->dbProfil), 396 EXTR_PREFIX_ALL, "form"); 397 $this->_beforeSaveUpdate($form, $form_daorec, $id); 398 $form_dao->update($form_daorec); 371 399 $form->saveAllFiles($this->uploadsDirectory); 372 400 $rep->action = $this->_getAction('view'); trunk/lib/jelix/controllers/jControllerDaoCrud.class.php
r891 r989 254 254 255 255 } 256 256 257 /** 258 * overload this method if you wan to do additionnal things on the dao generated by the 259 * jFormsBase::prepareDaoFromControls method 260 * @param jFormsBase $form the form 261 * @param jDaoRecordBase $form_daorec 262 */ 263 protected function _beforeSaveCreate($form, $form_daorec) { 264 265 } 266 257 267 /** 258 268 * save data of a form in a new record … … 267 277 268 278 if($form->check() && $this->_checkData($form, false)){ 269 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 279 extract($form->prepareDaoFromControls($this->dao,null,$this->dbProfil), 280 EXTR_PREFIX_ALL, "form"); 281 $this->_beforeSaveCreate($form, $form_daorec); 282 $form_dao->insert($form_daorec); 283 $id = $form_daorec->getPk(); 270 284 $form->saveAllFiles($this->uploadsDirectory); 271 285 $rep->action = $this->_getAction('view'); … … 354 368 355 369 } 370 371 /** 372 * overload this method if you wan to do additionnal things on the dao generated by the 373 * jFormsBase::prepareDaoFromControls method 374 * @param jFormsBase $form the form 375 * @param jDaoRecordBase $form_daorec 376 * @param mixed $id the new id of the updated record 377 */ 378 protected function _beforeSaveUpdate($form, $form_daorec, $id) { 379 380 } 356 381 357 382 /** … … 368 393 369 394 if($form->check() && $this->_checkData($form, true)){ 370 $id = $form->saveToDao($this->dao, null, $this->dbProfil); 395 extract($form->prepareDaoFromControls($this->dao,$id,$this->dbProfil), 396 EXTR_PREFIX_ALL, "form"); 397 $this->_beforeSaveUpdate($form, $form_daorec, $id); 398 $form_dao->update($form_daorec); 371 399 $form->saveAllFiles($this->uploadsDirectory); 372 400 $rep->action = $this->_getAction('view'); trunk/lib/jelix/CREDITS
r987 r989 28 28 Bastien Jaillot (aka bastnic) 29 29 - bug fix in jDaoGenerator (#282) 30 - little improvement in the jControllerDaoCrud API (#330, #487 )30 - little improvement in the jControllerDaoCrud API (#330, #487, #618) 31 31 - fixed minor bugs 32 32 - default template and response generated by createapp (#496, #480, #515) trunk/lib/jelix/CREDITS
r987 r989 28 28 Bastien Jaillot (aka bastnic) 29 29 - bug fix in jDaoGenerator (#282) 30 - little improvement in the jControllerDaoCrud API (#330, #487 )30 - little improvement in the jControllerDaoCrud API (#330, #487, #618) 31 31 - fixed minor bugs 32 32 - default template and response generated by createapp (#496, #480, #515) trunk/lib/jelix/CREDITS
r987 r989 28 28 Bastien Jaillot (aka bastnic) 29 29 - bug fix in jDaoGenerator (#282) 30 - little improvement in the jControllerDaoCrud API (#330, #487 )30 - little improvement in the jControllerDaoCrud API (#330, #487, #618) 31 31 - fixed minor bugs 32 32 - default template and response generated by createapp (#496, #480, #515) trunk/lib/jelix/CREDITS
r987 r989 28 28 Bastien Jaillot (aka bastnic) 29 29 - bug fix in jDaoGenerator (#282) 30 - little improvement in the jControllerDaoCrud API (#330, #487 )30 - little improvement in the jControllerDaoCrud API (#330, #487, #618) 31 31 - fixed minor bugs 32 32 - default template and response generated by createapp (#496, #480, #515)
