Created
August 27, 2012 05:14
-
-
Save neohunter/3485780 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
function beforeSave(){ | |
$d = &$this->data[$this->alias]; | |
if ( !$this->id && !isset($d['id']) ) { | |
//check if we already have that phone register (would be an update) | |
$id = $this->field('id', array('phone' => $d['phone'])); | |
$this->id = $d['id'] = $id; | |
} | |
if(isset($d['phone'])) | |
$d['phone'] = $this->escapePhone($d['phone']); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment