public function getProjectApplications($status = null) { if ($status == null || $status == "unapproved") { //return ProjectApplicationPeer::retrieveUnapprovedByUserId($this->getUserId()); return ProjectApplicationPeer::retrieveByUserId($this->getUserId()); } }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(ProjectApplicationPeer::ID, $pks, Criteria::IN); $objs = ProjectApplicationPeer::doSelect($criteria, $con); } return $objs; }
/** * Executes flagHelp action * */ public function executeFlagHelp() { $this->forward404Unless($projectApplication = ProjectApplicationPeer::retrieveByUuid($this->getRequestParameter('id')), 'Project not found using id: [' . $this->getRequestParameter('id') . ']'); if ($this->getRequest()->getMethod() == sfRequest::POST && $projectApplication->getOwnerId() == $this->getUser()->getId()) { $projectApplication->setFlaggedHelp(true); $projectApplication->save(); } $this->project = $projectApplication; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = ProjectApplicationPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setUuid($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setCreatedBy($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setOwnerId($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDepartmentId($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setCampusId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setTitle($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setPicture($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setSlug($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setDescription($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setNotes($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setCommunityBenefits($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setStudentReasons($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setKeywords($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setBegin($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setFinish($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setBudget($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setStatus($arr[$keys[17]]); } if (array_key_exists($keys[18], $arr)) { $this->setApplications($arr[$keys[18]]); } if (array_key_exists($keys[19], $arr)) { $this->setSeason($arr[$keys[19]]); } if (array_key_exists($keys[20], $arr)) { $this->setLength($arr[$keys[20]]); } if (array_key_exists($keys[21], $arr)) { $this->setPreferredTermLength($arr[$keys[21]]); } if (array_key_exists($keys[22], $arr)) { $this->setYear($arr[$keys[22]]); } if (array_key_exists($keys[23], $arr)) { $this->setScale($arr[$keys[23]]); } if (array_key_exists($keys[24], $arr)) { $this->setCommitment($arr[$keys[24]]); } if (array_key_exists($keys[25], $arr)) { $this->setGoals($arr[$keys[25]]); } if (array_key_exists($keys[26], $arr)) { $this->setGoalsComplete($arr[$keys[26]]); } if (array_key_exists($keys[27], $arr)) { $this->setHoursWeekly($arr[$keys[27]]); } if (array_key_exists($keys[28], $arr)) { $this->setHoursTotal($arr[$keys[28]]); } if (array_key_exists($keys[29], $arr)) { $this->setPublished($arr[$keys[29]]); } if (array_key_exists($keys[30], $arr)) { $this->setFlaggedAup($arr[$keys[30]]); } if (array_key_exists($keys[31], $arr)) { $this->setFlaggedHelp($arr[$keys[31]]); } if (array_key_exists($keys[32], $arr)) { $this->setPage1Complete($arr[$keys[32]]); } if (array_key_exists($keys[33], $arr)) { $this->setPage2Complete($arr[$keys[33]]); } if (array_key_exists($keys[34], $arr)) { $this->setPage3Complete($arr[$keys[34]]); } if (array_key_exists($keys[35], $arr)) { $this->setPage4Complete($arr[$keys[35]]); } if (array_key_exists($keys[36], $arr)) { $this->setLiability($arr[$keys[36]]); } if (array_key_exists($keys[37], $arr)) { $this->setLiabilityDetails($arr[$keys[37]]); } if (array_key_exists($keys[38], $arr)) { $this->setProfit($arr[$keys[38]]); } if (array_key_exists($keys[39], $arr)) { $this->setProfitDetails($arr[$keys[39]]); } if (array_key_exists($keys[40], $arr)) { $this->setIsApproved($arr[$keys[40]]); } if (array_key_exists($keys[41], $arr)) { $this->setPoints($arr[$keys[41]]); } if (array_key_exists($keys[42], $arr)) { $this->setApprovedBy($arr[$keys[42]]); } if (array_key_exists($keys[43], $arr)) { $this->setHits($arr[$keys[43]]); } if (array_key_exists($keys[44], $arr)) { $this->setVersion($arr[$keys[44]]); } if (array_key_exists($keys[45], $arr)) { $this->setUpdatedAt($arr[$keys[45]]); } if (array_key_exists($keys[46], $arr)) { $this->setDeletedAt($arr[$keys[46]]); } if (array_key_exists($keys[47], $arr)) { $this->setCreatedAt($arr[$keys[47]]); } }
public function getProjectApplicationsRelatedByOwnerIdJoinCampus($criteria = null, $con = null) { include_once 'lib/model/om/BaseProjectApplicationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collProjectApplicationsRelatedByOwnerId === null) { if ($this->isNew()) { $this->collProjectApplicationsRelatedByOwnerId = array(); } else { $criteria->add(ProjectApplicationPeer::OWNER_ID, $this->getId()); $this->collProjectApplicationsRelatedByOwnerId = ProjectApplicationPeer::doSelectJoinCampus($criteria, $con); } } else { $criteria->add(ProjectApplicationPeer::OWNER_ID, $this->getId()); if (!isset($this->lastProjectApplicationRelatedByOwnerIdCriteria) || !$this->lastProjectApplicationRelatedByOwnerIdCriteria->equals($criteria)) { $this->collProjectApplicationsRelatedByOwnerId = ProjectApplicationPeer::doSelectJoinCampus($criteria, $con); } } $this->lastProjectApplicationRelatedByOwnerIdCriteria = $criteria; return $this->collProjectApplicationsRelatedByOwnerId; }
/** * Executes zebSandbox action * */ public function executeZebSandbox() { $this->forward404Unless($this->project_app = ProjectApplicationPeer::retrieveByPk('26')); $this->user = sfGuardUserPeer::retrieveByUsername('*****@*****.**'); }
public function executeSetDeclined() { $proposal = ProjectApplicationPeer::retrieveByPK($this->getRequestParameter('id')); $proposal->setDeclined(); $this->redirect($this->getRequest()->getReferer()); }
public function getProjectApplicationsJoinDepartment($criteria = null, $con = null) { include_once 'lib/model/om/BaseProjectApplicationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collProjectApplications === null) { if ($this->isNew()) { $this->collProjectApplications = array(); } else { $criteria->add(ProjectApplicationPeer::CAMPUS_ID, $this->getId()); $this->collProjectApplications = ProjectApplicationPeer::doSelectJoinDepartment($criteria, $con); } } else { $criteria->add(ProjectApplicationPeer::CAMPUS_ID, $this->getId()); if (!isset($this->lastProjectApplicationCriteria) || !$this->lastProjectApplicationCriteria->equals($criteria)) { $this->collProjectApplications = ProjectApplicationPeer::doSelectJoinDepartment($criteria, $con); } } $this->lastProjectApplicationCriteria = $criteria; return $this->collProjectApplications; }