Skip to content

Instantly share code, notes, and snippets.

@Marian0
Last active August 29, 2015 14:11
Show Gist options
  • Save Marian0/babab18854a651d4269a to your computer and use it in GitHub Desktop.
Save Marian0/babab18854a651d4269a to your computer and use it in GitHub Desktop.
Model find example CAKE PHP
$alertasLlegando = $this->Alerta->find('all', array('conditions' => array(
'Alerta.lat >= ' => $area['lat1'],
'Alerta.lat <= ' => $area['lat2'],
'Alerta.lng <= ' => $area['lng1'],
'Alerta.lng <= ' => $area['lng2'],
'Alerta.estado' => 'llegando',
),
'limit' => 5,
'order' => array('Alerta.updated' => 'DESC')
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment