Created
December 4, 2012 10:48
-
-
Save veganista/4202602 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function beforeSave(Model $model, array $options = array()){ | |
var_dump($model->data['User']); | |
//array (size=4) | |
// 'id' => string '66' (length=2) | |
// 'first_name' => string 'new first name' (length=14) | |
// 'last_name' => string 'new last name' (length=13) | |
// 'email' => string '[email protected]' (length=14) | |
$x = $model->find('first', array('conditions' => array($model->alias . '.' .$model->primaryKey => $model->id), 'contain' => 'User')); | |
var_dump($x['User']); | |
//array (size=10) | |
// 'id' => string '66' (length=2) | |
// 'first_name' => string 'new first name' (length=14) | |
// 'last_name' => string 'new last name' (length=13) | |
// 'email' => string '[email protected]' (length=14) | |
// 'password' => string '*********************************' (length=40) | |
// 'password_reset_key' => string '' (length=0) | |
// 'password_reset_expiry' => string '0000-00-00 00:00:00' (length=19) | |
// 'group_id' => string '2' (length=1) | |
// 'created' => string '2012-12-03 15:15:18' (length=19) | |
// 'updated' => string '2012-12-04 11:55:32' (length=19) | |
die(); | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var_dump($this->request->data['User']); | |
//output of var_dump()..... | |
//array (size=4) | |
// 'id' => string '66' (length=2) | |
// 'first_name' => string 'new first name' (length=14) | |
// 'last_name' => string 'new last name' (length=13) | |
// 'email' => string '[email protected]' (length=14) | |
if ($this->Applicant->saveAssociated($this->request->data, array('deep' => true))) { | |
$this->Session->setFlash(__('The applicant has been updated'), 'Flash/success'); | |
$this->redirect(array('action' => 'index')); | |
} else { | |
$this->Session->setFlash(__('The applicant could not be updated Please, try again'), 'Flash/error'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment