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
<?php | |
App::uses('AppModel', 'Model'); | |
/** | |
* Setting Model | |
* | |
*/ | |
class Setting extends AppModel { | |
/** | |
* Display field |
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
# modo de uso de emails | |
options = {} | |
gmail.emails(options) do |email| | |
# aqui tengo cada email.. | |
end | |
# Quiero crear un metodo llamado search que me llame emails de un modo particular, la idea es que esto funcione: | |
gmail.search('pepito moreno') do |email| | |
# aqui tendria cada email, igual que si hubiera llamado gmail.emails |
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'])) |
NewerOlder