public function getVStudentElsesJoinPaymentModel($criteria = null, $con = null) { include_once 'lib/model/om/BaseVStudentElsePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVStudentElses === null) { if ($this->isNew()) { $this->collVStudentElses = array(); } else { $criteria->add(VStudentElsePeer::ACADEMIC_COST_ID, $this->getId()); $this->collVStudentElses = VStudentElsePeer::doSelectJoinPaymentModel($criteria, $con); } } else { $criteria->add(VStudentElsePeer::ACADEMIC_COST_ID, $this->getId()); if (!isset($this->lastVStudentElseCriteria) || !$this->lastVStudentElseCriteria->equals($criteria)) { $this->collVStudentElses = VStudentElsePeer::doSelectJoinPaymentModel($criteria, $con); } } $this->lastVStudentElseCriteria = $criteria; return $this->collVStudentElses; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = VStudentElsePeer::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->setCode2($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setName($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setAcademicCalendarId($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setClassGroupId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setAcademicCostId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setAcademicCostComponentId($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setPaymentModelId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setStatus($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setPaymentStatus($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setPaidAt($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setMonth($arr[$keys[12]]); } }
public function filterElse($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'DEPARTMENT_ID') { $c->addJoin(AcademicCalendarPeer::ID, VStudentElsePeer::ACADEMIC_CALENDAR_ID); $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID); $column = DepartmentPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'CLASS_NAME') { $c->addJoin(ClassGroupPeer::ID, VStudentElsePeer::CLASS_GROUP_ID); $column = ClassGroupPeer::getTableMap()->getColumn('NAME'); } else { $column = VStudentElsePeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { #$c->add($name, $value, Criteria::EQUAL ); $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::DATE) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::INTEGER) { if ($name == StudentPeer::CLASS_GROUP_ID) { $cg = ClassGroupPeer::retrieveByPK($value); $c->add($name, $cg->getChildRecurs(), Criteria::IN); } else { $c->add($name, $value, Criteria::EQUAL); } } else { if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) { if ($name == VStudentElsePeer::PAYMENT_STATUS) { if ($value != 5) { $c->add($name, "%{$value}%", Criteria::LIKE); } else { $c->add($name, null, Criteria::EQUAL); } } else { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } } } }
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(VStudentElsePeer::ID, $pks, Criteria::IN); $objs = VStudentElsePeer::doSelect($criteria, $con); } return $objs; }