Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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