Skip to content

Instantly share code, notes, and snippets.

@tareko
Created September 24, 2012 16:57
Show Gist options
  • Select an option

  • Save tareko/3777004 to your computer and use it in GitHub Desktop.

Select an option

Save tareko/3777004 to your computer and use it in GitHub Desktop.
function I'm testing
function lastUpdated($id, Shift $shift) {
App::uses('Shift', 'Model');
$this->Shift = $shift;
$calendar = $this->findById($id, array(
'start_date', 'end_date'));
return $this->Shift->find('first', array(
'fields' => array('Shift.updated'),
'conditions' => array(
'Shift.date >=' => $calendar['Calendar']['start_date'],
'Shift.date <=' => $calendar['Calendar']['end_date'],
),
'order' => array(
'Shift.updated' => 'DESC',
)
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment