- En el módulo entity agregamos:
protected function _getLabel()
{
return $this->_properties['nombreDelCampoX'] . ' - ' . $this->_properties['NombreDelCampoY'];
}
- En el controlador al hacer la búsqueda escribimos
$discounts = $this->Discounts->find('list', ['limit' => 200,
'order' => ["discount_amount" => "ASC"],
'keyField' => 'id',
'valueField' => function ($discount)
{
return $discount->get('label');
}]);
Fuente: https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html