Вы можете указать поля, которые вы хотите отобразить в раскрывающемся списке, добавив параметр 'fields' в find (), и вы можете использовать virtualField в своей модели Doctor, чтобы получить имя (или полное имя).
doctor.php:
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
// This is for MySQL, change for whatever DB flavour you're using.
$this->virtualFields = array(
'name' => "CONCAT(`{$this->alias}`.`prefix`, ' ', `{$this->alias}`.`firstname`, ' ', `{$this->alias}`.`lastname`)"
);
}
Измените свою находку ('список') в вашем контроллере на:
$this->set('doctors', $this->Appointment->Doctor->find(
'list',
array(
'fields' => array('Doctor.name')
)
);
Вы, конечно, можете добавить параметр 'order'...
$this->set('doctors', $this->Appointment->Doctor->find(
'list',
array(
'fields' => array('Doctor.name'),
'order' => array('Doctor.firstname', 'Doctor.lastname')
)
);
Надеюсь, это поможет.