public function getVFinalRaports($criteria = null, $con = null) { include_once 'lib/model/om/BaseVFinalRaportPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVFinalRaports === null) { if ($this->isNew()) { $this->collVFinalRaports = array(); } else { $criteria->add(VFinalRaportPeer::SUBJECT_ID, $this->getId()); VFinalRaportPeer::addSelectColumns($criteria); $this->collVFinalRaports = VFinalRaportPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VFinalRaportPeer::SUBJECT_ID, $this->getId()); VFinalRaportPeer::addSelectColumns($criteria); if (!isset($this->lastVFinalRaportCriteria) || !$this->lastVFinalRaportCriteria->equals($criteria)) { $this->collVFinalRaports = VFinalRaportPeer::doSelect($criteria, $con); } } } $this->lastVFinalRaportCriteria = $criteria; return $this->collVFinalRaports; }
public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VFinalRaportPeer::addSelectColumns($c); $startcol2 = VFinalRaportPeer::NUM_COLUMNS - VFinalRaportPeer::NUM_LAZY_LOAD_COLUMNS + 1; StudentCoursePeer::addSelectColumns($c); $startcol3 = $startcol2 + StudentCoursePeer::NUM_COLUMNS; GradeComponentPeer::addSelectColumns($c); $startcol4 = $startcol3 + GradeComponentPeer::NUM_COLUMNS; GradeSpecPeer::addSelectColumns($c); $startcol5 = $startcol4 + GradeSpecPeer::NUM_COLUMNS; CitationPeer::addSelectColumns($c); $startcol6 = $startcol5 + CitationPeer::NUM_COLUMNS; SubjectPeer::addSelectColumns($c); $startcol7 = $startcol6 + SubjectPeer::NUM_COLUMNS; $c->addJoin(VFinalRaportPeer::STUDENT_COURSE_ID, StudentCoursePeer::ID); $c->addJoin(VFinalRaportPeer::GRADE_COMPONENT_ID, GradeComponentPeer::ID); $c->addJoin(VFinalRaportPeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $c->addJoin(VFinalRaportPeer::CITATION_ID, CitationPeer::ID); $c->addJoin(VFinalRaportPeer::SUBJECT_ID, SubjectPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VFinalRaportPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = StudentCoursePeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getStudentCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVFinalRaport($obj1); break; } } if ($newObject) { $obj2->initVFinalRaports(); $obj2->addVFinalRaport($obj1); } $omClass = GradeComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getGradeComponent(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVFinalRaport($obj1); break; } } if ($newObject) { $obj3->initVFinalRaports(); $obj3->addVFinalRaport($obj1); } $omClass = GradeSpecPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getGradeSpec(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVFinalRaport($obj1); break; } } if ($newObject) { $obj4->initVFinalRaports(); $obj4->addVFinalRaport($obj1); } $omClass = CitationPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getCitation(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addVFinalRaport($obj1); break; } } if ($newObject) { $obj5->initVFinalRaports(); $obj5->addVFinalRaport($obj1); } $omClass = SubjectPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getSubject(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addVFinalRaport($obj1); break; } } if ($newObject) { $obj6->initVFinalRaports(); $obj6->addVFinalRaport($obj1); } $results[] = $obj1; } return $results; }