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(PositionMilestonePeer::ID, $pks, Criteria::IN); $objs = PositionMilestonePeer::doSelect($criteria, $con); } return $objs; }
public function countPositionMilestones($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BasePositionMilestonePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(PositionMilestonePeer::POSITION_ID, $this->getId()); return PositionMilestonePeer::doCount($criteria, $distinct, $con); }
public function getMilestones($sort_by = "deadline", $direction = "asc") { return PositionMilestonePeer::retrieveSortedByPositionId($this->getId(), $sort_by, $direction); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = PositionMilestonePeer::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->setPositionId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setTitle($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setDescription($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setDeliverables($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setDeadline($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setStatus($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setRank($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setFilled($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setUpdatedAt($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setDeletedAt($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setCreatedAt($arr[$keys[12]]); } }
/** * Executes updateMilestone action * */ public function executeUpdateMilestone() { $this->forward404Unless($this->project = ProjectPeer::retrieveBySlug($this->getRequestParameter('project')), 'Project does not exist, using slug [' . $this->getRequestParameter('project') . ']'); $this->tab = sfConfig::get('app_tab_project_team'); $this->forward404Unless($this->position = ProjectPositionPeer::retrieveByUuid($this->getRequestParameter('position')), 'Position not found, unable to add milestone'); $milestone = PositionMilestonePeer::retrieveByUuid($this->getRequestParameter('milestone')); if ($milestone == null) { $milestone = new PositionMilestone(); } $milestone->setTitle($this->getRequestParameter('milestone_title')); if ($this->getRequestParameter('milestone_deadline')) { list($d, $m, $y) = sfI18N::getDateForCulture($this->getRequestParameter('milestone_deadline'), $this->getUser()->getCulture()); $milestone->setDeadline("{$y}-{$m}-{$d}"); } $milestone->setDescription($this->getRequestParameter('milestone_description')); $milestone->setDeliverables($this->getRequestParameter('milestone_deliverables')); $milestone->save(); if (sfContext::getInstance()->getRequest()->isXmlHttpRequest()) { # Should we do something special here, if the request is ajax? Perhaps we can separate ajax and non-ajax paths here } }