public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = NgRegTestDetailPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setNgRegTestPeriodId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setStart($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setEnd($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setTitle($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setDetail($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setCreated($arr[$keys[6]]); } }
public function countNgRegTestDetails($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseNgRegTestDetailPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(NgRegTestDetailPeer::NG_REG_TEST_PERIOD_ID, $this->getId()); return NgRegTestDetailPeer::doCount($criteria, $distinct, $con); }
public function executeSave() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $ng_reg_test_detail = new NgRegTestDetail(); } else { $ng_reg_test_detail = NgRegTestDetailPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($ng_reg_test_detail); } $this->ng_reg_period = NgRegPeriodPeer::retrieveByPK($this->getRequestParameter('ng_reg_period_id')); $this->forward404Unless($this->ng_reg_period); $ng_reg_test_detail->setId($this->getRequestParameter('id')); $ng_reg_test_detail->setTitle($this->getRequestParameter('title')); $ng_reg_test_detail->setDetail($this->getRequestParameter('detail')); $ng_reg_test_detail->setNgRegTestPeriodId($this->getRequestParameter('ng_reg_test_period_id')); if ($this->getRequestParameter('start')) { $ng_reg_test_detail->setStart($this->getRequestParameter('start')); } if ($this->getRequestParameter('end')) { $ng_reg_test_detail->setEnd($this->getRequestParameter('end')); } $ng_reg_test_detail->save(); return $this->redirect('ng_reg_detail/listDetail?id=' . $this->ng_reg_period->getId()); }
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(NgRegTestDetailPeer::ID, $pks, Criteria::IN); $objs = NgRegTestDetailPeer::doSelect($criteria, $con); } return $objs; }