I'm trying to perform a search on the database that returns the smallest and greatest value of the 'time' field using the following code in CakePHP 3:
$pedidos = TableRegistry::get('Pedidos');
$hora_max = $pedidos->find('list', array('fields' => array('MAX(hora) AS 'hora_maxima')));
$hora_minima = $pedidos->find('list', array('fields' => array('MIN(hora) AS 'hora_minima')));
debug($hora_maxima);
However it returns me the following error:
syntax error, unexpected T_OBJECT_OPERATOR.
Could someone please help me?