protected function createAdvancedSearchCriteria($arr)
 {
     $c = new Criteria();
     if (strlen($arr['jobStatus'])) {
         $c->add(JobPeer::STATUS_ID, $arr["jobStatus"]);
     }
     if (!is_null($arr["dueDateStart"])) {
         $c->add(JobPeer::DUE_DATE, $arr["dueDateStart"], Criteria::GREATER_EQUAL);
     }
     if (!is_null($arr["dueDateEnd"])) {
         $c->addAnd(JobPeer::DUE_DATE, $arr["dueDateEnd"], Criteria::LESS_EQUAL);
     }
     if (!is_null($arr["shootDateStart"])) {
         $c->add(JobPeer::DATE, $arr["shootDateStart"], Criteria::GREATER_EQUAL);
     }
     if (!is_null($arr["shootDateEnd"])) {
         $c->addAnd(JobPeer::DATE, $arr["shootDateEnd"], Criteria::LESS_EQUAL);
     }
     if (strlen($arr["clientId"])) {
         $jobIds = JobClientPeer::getJobsByClientId($arr["clientId"]);
         $c->add(JobPeer::ID, $jobIds, Criteria::IN);
     }
     if (strlen($arr["photographerId"])) {
         $jobIds = JobPhotographerPeer::getJobsByPhotographerId($arr["photographerId"]);
         $c->addAnd(JobPeer::ID, $jobIds, Criteria::IN);
     }
     if ($arr["sortDirection"] == 1) {
         $c->addDescendingOrderByColumn($arr["sortOn"]);
     } else {
         $c->addAscendingOrderByColumn($arr["sortOn"]);
     }
     return $c;
 }
 public function executeViewJobs(sfWebRequest $request)
 {
     $this->photographer = $this->getRoute()->getObject();
     $ids = JobPhotographerPeer::getJobsByPhotographerId($this->photographer->getId());
     $c = new Criteria();
     $c->add(JobPeer::ID, $ids, Criteria::IN);
     $this->getPager($c, array("route" => "photographer_view_jobs", "slugOn" => "slug", "slug" => $this->photographer->getSlug()));
 }
 private function reloadByPhotographer($photographerId)
 {
     $c = new Criteria();
     $this->routeObject = PhotographerPeer::retrieveByPK($photographerId);
     $ids = JobPhotographerPeer::getJobsByPhotographerId($photographerId);
     $c->add(JobPeer::ID, $ids, Criteria::IN);
     $this->route = "photographer_view_jobs";
     $this->propelType = "slug";
     $this->renderStatus = true;
     $this->viewingCaption = " jobs for " . $this->routeObject->getName();
     return $c;
 }