Example #1
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = VStudentWakafPeer::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]]);
     }
 }
Example #2
0
 public function filterWakaf($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, VStudentWakafPeer::ACADEMIC_CALENDAR_ID);
             $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
             $column = DepartmentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassGroupPeer::ID, VStudentWakafPeer::CLASS_GROUP_ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = VStudentWakafPeer::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 == VStudentWakafPeer::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);
                         }
                     }
                 }
             }
         }
     }
 }
Example #3
0
 public function getVStudentWakafsJoinPaymentModel($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVStudentWakafPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVStudentWakafs === null) {
         if ($this->isNew()) {
             $this->collVStudentWakafs = array();
         } else {
             $criteria->add(VStudentWakafPeer::ACADEMIC_COST_ID, $this->getId());
             $this->collVStudentWakafs = VStudentWakafPeer::doSelectJoinPaymentModel($criteria, $con);
         }
     } else {
         $criteria->add(VStudentWakafPeer::ACADEMIC_COST_ID, $this->getId());
         if (!isset($this->lastVStudentWakafCriteria) || !$this->lastVStudentWakafCriteria->equals($criteria)) {
             $this->collVStudentWakafs = VStudentWakafPeer::doSelectJoinPaymentModel($criteria, $con);
         }
     }
     $this->lastVStudentWakafCriteria = $criteria;
     return $this->collVStudentWakafs;
 }
Example #4
0
 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(VStudentWakafPeer::ID, $pks, Criteria::IN);
         $objs = VStudentWakafPeer::doSelect($criteria, $con);
     }
     return $objs;
 }