<?php | |
# /app/Model/Contact.php | |
class Contact extends AppModel { | |
public $displayField = 'fullname'; | |
public $virtualFields = array( | |
'fullname' => 'CONCAT(Contact.name, " ", Contact.surname)', | |
'withCompany' => 'CONCAT(Contact.name, " ", Contact.surname, " - ", Contact.company', | |
'bySurname' => 'CONCAT(Contact.surname, " ", Contact.name)', | |
'createdIta' => 'DATE_FORMAT(Contact.created,"%d/%m/%Y")' | |
); | |
public function getUserInfos($id) { | |
$this->virtualFields['userInfos'] = 'CONCAT(Contact.name, " ", Contact.surname, " - iscritto il ", Contact.created'; | |
return $this->findById($id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment