Skip to content

Instantly share code, notes, and snippets.

@Casperhr
Created October 30, 2014 14:03
Show Gist options
  • Select an option

  • Save Casperhr/d817ca3e959d21130b9d to your computer and use it in GitHub Desktop.

Select an option

Save Casperhr/d817ca3e959d21130b9d to your computer and use it in GitHub Desktop.
if (!empty($this->request->query['search'])) {
$conditions = array_merge($conditions, array($this->Listing->getSearchConditions($this->request->query['search'])));
}
switch ($this->request->query('searchState')) {
case 'archived':
$conditions = array_merge($conditions, array($this->Listing->getArchivedConditions($expireTime)));
break;
case 'all':
break;
default:
$conditions = array_merge($conditions, $this->Listing->getStandardConditions($expireTime));
break;
}
if(($this->request->query['searchState'] === 'live') || ($this->request->query['searchState'] === 'new')) {
if ($this->request->query['searchState'] === 'live') {
$conditions['Listing.is_ready'] = true;
} else if ($this->request->query['searchState'] === 'new') {
$conditions['Listing.is_ready'] = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment