Created
February 27, 2016 14:31
-
-
Save cakephp-tutorial/bd7f82734c688cd4daf8 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
<?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)', | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment