public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = VAcaCostPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCode($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setAmount($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setPayerTypeId($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setAcademicCalendarId($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setAcademicCostComponentId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setAcademicProcessId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setBankAccountId($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setClassGroupId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setDescription($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setPayerCode($arr[$keys[10]]); } }
public function getVAcaCostsJoinClassGroup($criteria = null, $con = null) { include_once 'lib/model/om/BaseVAcaCostPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVAcaCosts === null) { if ($this->isNew()) { $this->collVAcaCosts = array(); } else { $criteria->add(VAcaCostPeer::PAYER_TYPE_ID, $this->getId()); $this->collVAcaCosts = VAcaCostPeer::doSelectJoinClassGroup($criteria, $con); } } else { $criteria->add(VAcaCostPeer::PAYER_TYPE_ID, $this->getId()); if (!isset($this->lastVAcaCostCriteria) || !$this->lastVAcaCostCriteria->equals($criteria)) { $this->collVAcaCosts = VAcaCostPeer::doSelectJoinClassGroup($criteria, $con); } } $this->lastVAcaCostCriteria = $criteria; return $this->collVAcaCosts; }
public function executePrintFormSpp() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'student_type'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $paid_at = $this->getRequestParameter('paid_at'); $year = $this->getRequestParameter('year'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $cr = new Criteria(); $cr->add(StudentTypePeer::STUDENT_ID, $student->getId()); $stu_type = StudentTypePeer::doSelectOne($cr); $c = new Criteria(); $cton1 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN); $cton2 = $c->getNewCriterion(VAcaCostPeer::CLASS_GROUP_ID, $student->getClassGroup()->getParentRecurs(), Criteria::IN); $cton3 = $c->getNewCriterion(VAcaCostPeer::PAYER_CODE, $stu_type->getPayerType()->getCode(), Criteria::IN); $cton4 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_COST_COMPONENT_ID, 13, Criteria::IN); $cton3->addAnd($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); $ac_cost = VAcaCostPeer::doSelectOne($c); $this->forward404Unless($ac_cost); $this->ac_cost = $ac_cost; $this->subtitle = $student->toString(); $this->student = $student; $this->paid_at = $paid_at; $this->year = $year; $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('VAcaCost', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $this->papersize = 'gdscform'; $this->orientation = 'landscape'; $this->setViewClass('sfDomPDF'); }
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(VAcaCostPeer::ID, $pks, Criteria::IN); $objs = VAcaCostPeer::doSelect($criteria, $con); } return $objs; }