예제 #1
0
 public function getDegree()
 {
     $c = new Criteria();
     $c->addJoin(UserPeer::DEGREE_ID, DegreePeer::ID);
     $c->add(UserPeer::ID, $this->getId());
     return DegreePeer::doSelectOne($c);
 }
예제 #2
0
 public function getDegree($con = null)
 {
     include_once 'lib/model/om/BaseDegreePeer.php';
     if ($this->aDegree === null && $this->degree_id !== null) {
         $this->aDegree = DegreePeer::retrieveByPK($this->degree_id, $con);
     }
     return $this->aDegree;
 }
 public static function doSelectJoinAllExceptRegionRelatedByRegionId(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantParentsPeer::addSelectColumns($c);
     $startcol2 = TestApplicantParentsPeer::NUM_COLUMNS - TestApplicantParentsPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     CountryPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + CountryPeer::NUM_COLUMNS;
     DegreePeer::addSelectColumns($c);
     $startcol6 = $startcol5 + DegreePeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantParentsPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::COUNTRY_ID, CountryPeer::ID);
     $c->addJoin(TestApplicantParentsPeer::DEGREE_ID, DegreePeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantParentsPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = TestApplicantPeer::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->getTestApplicant();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicantParentss();
             $obj2->addTestApplicantParents($obj1);
         }
         $omClass = ReligionPeer::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->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestApplicantParentss();
             $obj3->addTestApplicantParents($obj1);
         }
         $omClass = CountryPeer::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->getCountry();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initTestApplicantParentss();
             $obj4->addTestApplicantParents($obj1);
         }
         $omClass = DegreePeer::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->getDegree();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initTestApplicantParentss();
             $obj5->addTestApplicantParents($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #4
0
 public function executeBulkupload()
 {
     if ($this->getRequest()->getFileName('csvfile')) {
         $fileName = md5($this->getRequest()->getFileName('csvfile') . time() . rand(0, 99999));
         $ext = $this->getRequest()->getFileExtension('csvfile');
         $this->getRequest()->moveFile('csvfile', sfConfig::get('sf_upload_dir') . "//csvfiles//" . $fileName . ".csv");
         $fullname = $fileName . ".csv";
         //$fullpath = '/uploads/csvfiles/'.$fullname;
         $fp = sfConfig::get('sf_upload_dir') . "//csvfiles//" . $fileName . ".csv";
         $reader = new sfCsvReader($fp, ',', '"');
         $reader->open();
         $i = 1;
         $exist;
         $ignore;
         $log;
         $ignoreflag = 0;
         $success = 0;
         while ($data = $reader->read()) {
             $name[] = array();
             $name = explode(' ', $data[0]);
             $roll = $data[1];
             $enrol = $data[2];
             $branch = $data[3];
             $degree = $data[4];
             $year = $data[5];
             $c = new Criteria();
             $c->add(UserPeer::ENROLMENT, $enrol);
             $user = UserPeer::doSelectOne($c);
             if (!$user) {
                 $c = new Criteria();
                 $c->add(BranchPeer::CODE, $branch);
                 $br = BranchPeer::doSelectOne($c);
                 if (!$br) {
                     $br = new Branch();
                     $br->setName($branch);
                     $br->setCode($branch);
                     $br->save();
                 }
                 $c = new Criteria();
                 $c->add(DegreePeer::NAME, $degree);
                 $dg = DegreePeer::doSelectOne($c);
                 if (!$dg) {
                     $dg = new Degree();
                     $dg->setName($degree);
                     $dg->save();
                 }
                 $user = new User();
                 if ($roll) {
                     $user->setRoll($roll);
                     $user->setRollflag(sfConfig::get('app_defaultprivacy_roll'));
                 }
                 if ($enrol) {
                     $user->setEnrolment($enrol);
                     $user->setEnrolflag(sfConfig::get('app_defaultprivacy_enrol'));
                 } else {
                     $ignoreflag = 1;
                 }
                 if ($year) {
                     $user->setGraduationyear($year);
                     $user->setGraduationyearflag(sfConfig::get('app_defaultprivacy_year'));
                 }
                 $user->setBranchId($br->getId());
                 $user->setBranchflag(sfConfig::get('app_defaultprivacy_branch'));
                 $user->setDegreeId($dg->getId());
                 $user->setDegreeflag(sfConfig::get('app_defaultprivacy_degree'));
                 $user->setIslocked(sfConfig::get('app_islocked_unclaimed'));
                 $user->setUsertype(sfConfig::get('app_usertypecode_Alumni'));
                 $lastname = '';
                 $personal = new Personal();
                 $name[0] = str_replace('.', '', $name[0]);
                 $personal->setFirstname($name[0]);
                 if ($name[3]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $name[2] = str_replace('.', '', $name[2]);
                     $name[3] = str_replace('.', '', $name[3]);
                     $midname = $name[1] . " " . $name[2];
                     $personal->setMiddlename($midname);
                     $personal->setLastname($name[3]);
                     $lastname = $name[3];
                 } elseif ($name[2]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $name[2] = str_replace('.', '', $name[2]);
                     $personal->setMiddlename($name[1]);
                     $personal->setLastname($name[2]);
                     $lastname = $name[2];
                 } elseif ($name[1]) {
                     $name[1] = str_replace('.', '', $name[1]);
                     $personal->setLastname($name[1]);
                     $lastname = $name[1];
                 }
                 $uname_suffix = $branch . substr($year, -2);
                 if ($lastname) {
                     $username = $name[0] . '.' . $lastname . '@';
                 } else {
                     $username = $name[0] . '@';
                 }
                 $temp = 1;
                 $tempusername = $username;
                 while ($this->uniqueuser($tempusername . $uname_suffix)) {
                     $tempusername = $username . $temp;
                     $temp++;
                 }
                 $tempusername = $tempusername . $uname_suffix;
                 $user->setUsername($tempusername);
                 if ($ignoreflag == 0) {
                     $e = $user->save();
                     $personal->setUserId($user->getId());
                     $personal->save();
                     $success++;
                     $log[$i][0] = $e == 1 ? "{$i}) Uploaded Successfully" : $e;
                     $log[$i][1] = $data[0];
                 } else {
                     $ignore[] = $i;
                     $ignoreflag = 0;
                     $log[$i][0] = "{$i}) NO enrolment number";
                     $log[$i][1] = $data[0];
                 }
             } else {
                 $exist[] = $i;
                 $log[$i][0] = "{$i}) In Database as " . $user->getFullname() . ", " . $user->getBranchname() . " " . $user->getGraduationyear();
                 $log[$i][1] = $data[0];
             }
             $i++;
         }
         // while ($data = $reader->read()) ends here
         $reader->close();
         $this->log = $log;
         $this->success = $success;
         $this->ignored = $ignore;
         $this->exists = $exist;
     }
 }
예제 #5
0
 public static function doSelectJoinAllExceptBranch(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     UserPeer::addSelectColumns($c);
     $startcol2 = UserPeer::NUM_COLUMNS - UserPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     DegreePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + DegreePeer::NUM_COLUMNS;
     $c->addJoin(UserPeer::DEGREE_ID, DegreePeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = UserPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = DegreePeer::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->getDegree();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addUser($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initUsers();
             $obj2->addUser($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #6
0
 public static function doSelectOrdered(Criteria $criteria, $con = null)
 {
     $criteria->addAscendingOrderByColumn(DegreePeer::CODE);
     $result = DegreePeer::doSelect($criteria);
     return $result;
 }
예제 #7
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(DegreePeer::ID, $pks, Criteria::IN);
         $objs = DegreePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #8
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = DegreePeer::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->setDescription($arr[$keys[2]]);
     }
 }
예제 #9
0
 public function executeDelete()
 {
     $degree = DegreePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($degree);
     $ref_error = 0;
     foreach ($degree->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $degree->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('degree/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('degree/delete', '_ERR_DELETE_ (' . $degree->toString() . ' - id:' . $degree->getId() . ')');
     } else {
         $degree->delete();
     }
     return $this->forward('degree', 'list');
 }
예제 #10
0
    public function executeRegistration()
    {
        $userid = $this->getRequestParameter('userid');
        $this->getUser()->getAttributeHolder()->remove('claimerid');
        $roll = $this->getRequestParameter('roll');
        $hawa = $this->getRequestParameter('hawa');
        $city = $this->getRequestParameter('city');
        $hod = $this->getRequestParameter('hod');
        $director = $this->getRequestParameter('director');
        $teacher = $this->getRequestParameter('favteacher');
        $lanka = $this->getRequestParameter('favlankashop');
        $email = $this->getRequestParameter('email');
        $other = $this->getRequestParameter('otherinfo');
        $dusername = $this->getRequestParameter('dusername');
        $mob = $this->getRequestParameter('mob');
        if (!$userid) {
            $fname = $this->getRequestParameter('fname');
            $mname = $this->getRequestParameter('mname');
            $lname = $this->getRequestParameter('lname');
            $year = $this->getRequestParameter('year');
            $dusername = $this->getRequestParameter('dusername');
            $formerrors1 = array();
            if (!$fname) {
                $formerrors1[] = 'Please enter first name';
            }
            if (!$lname) {
                $formerrors1[] = 'Please enter last name';
            }
            if (!$dusername) {
                $formerrors1[] = 'Please enter username';
            }
            if ($formerrors1) {
                $this->getRequest()->setErrors($formerrors1);
                $this->forward('home', 'getmyaccount');
            }
            $branchn = BranchPeer::retrieveByPK($this->getRequestParameter('branchid'));
            $degreen = DegreePeer::retrieveByPK($this->getRequestParameter('degreeid'));
            if (!$dusername) {
                $newusername = $fname . "." . $lname . "@" . $branchn->getCode() . substr($year, -2);
            } else {
                $newusername = $dusername;
            }
            $currentyear = date('Y');
            if ($currentyear <= $year) {
                $usertype = '0';
            } else {
                $usertype = '1';
            }
            $user = new User();
            $user->setUsername($newusername);
            $user->setRoll($roll);
            $user->setRollflag(sfConfig::get('app_defaultprivacy_roll'));
            $user->setGraduationyear($year);
            $user->setGraduationyearflag(sfConfig::get('app_defaultprivacy_year'));
            $user->setBranchId($branchn->getId());
            $user->setBranchflag(sfConfig::get('app_defaultprivacy_branch'));
            $user->setDegreeId($degreen->getId());
            $user->setDegreeflag(sfConfig::get('app_defaultprivacy_degree'));
            $user->setUsertype($usertype);
            $user->setTempemail($email);
            $user->setIslocked(sfConfig::get('app_islocked_newreg'));
            $user->save();
            $personal = new Personal();
            $personal->setUserId($user->getId());
            $personal->setFirstname($fname);
            $personal->setMiddlename($mname);
            $personal->setLastname($lname);
            $personal->setEmail($email);
            $personal->setMobile($mob);
            $personal->save();
            $userid = $user->getId();
        } else {
            $user = UserPeer::retrieveByPK($userid);
            $user->setIslocked(sfConfig::get('app_islocked_claimed'));
            $user->save();
        }
        $c = new Criteria();
        $c->add(ClaiminfoPeer::USER_ID, $userid);
        $claiminfo = ClaiminfoPeer::doSelectOne($c);
        if ($claiminfo) {
            $this->user = $claiminfo->getUser();
            $this->claiminfo = $claiminfo;
        } else {
            $claiminfo = new Claiminfo();
            $claiminfo->setUserId($userid);
            $claiminfo->setRoll($roll);
            $claiminfo->setHawa($hawa);
            $claiminfo->setCity($city);
            $claiminfo->setHod($hod);
            $claiminfo->setDirector($director);
            $claiminfo->setTeacher($teacher);
            $claiminfo->setLankashop($lanka);
            $claiminfo->setOther($other);
            $claiminfo->setDusername($dusername);
            $claiminfo->save();
            $this->claiminfo = $claiminfo;
            $this->user = $user;
            if ($user) {
                $username = $user->getUsername();
                $personal = $user->getPersonal();
                $personal->setEmail($email);
                $personal->save();
                $sendermail = sfConfig::get('app_from_mail');
                $sendername = sfConfig::get('app_from_name');
                $to = sfConfig::get('app_to_adminmail');
                $subject = "Registration request for ITBHU Global Org";
                $body = '
	  Hi,
	 
	  I want to connect to ITBHU Global. My verification information is: 
	
	';
                $body = $body . 'Roll Number           : ' . $roll . '
	';
                $body = $body . 'HAWA                  :  ' . $hawa . '
	';
                $body = $body . 'City                  :  ' . $city . '
	';
                $body = $body . 'HoD                   :  ' . $hod . '
	';
                $body = $body . 'Director              :  ' . $director . '
	';
                $body = $body . 'Favourite Teacher     :  ' . $teacher . '
	';
                $body = $body . 'Favuorite Lanka Shop  :  ' . $lanka . '
	';
                $body = $body . 'My Email              :  ' . $email . '
	';
                $body = $body . 'Username I am claiming: ' . $username . '
	';
                $body = $body . 'Desired Username      : '******'
	';
                $body = $body . 'Thanks,';
                $body = $body . '
	' . $user->getFullname();
                //send mail to admin
                $mail = myUtility::sendmail($sendermail, $sendername, $sendermail, $sendername, $sendermail, $to, $subject, $body);
                //send mail to class authorizer
                $ca = new Criteria();
                $ca->add(UserPeer::GRADUATIONYEAR, $user->getGraduationyear());
                $ca->add(UserPeer::BRANCH_ID, $user->getBranchId());
                $ca->addJoin(UserPeer::ID, UserrolePeer::USER_ID);
                $ca->add(UserrolePeer::ROLE_ID, sfConfig::get('app_role_auth'));
                $authusers = UserPeer::doSelect($ca);
                //if class authorizers are available.
                if ($authusers) {
                    foreach ($authusers as $authuser) {
                        $toauth = $authuser->getEmail();
                        $mail = myUtility::sendmail($sendermail, $sendername, $sendermail, $sendername, $sendermail, $toauth, $subject, $body);
                    }
                    $user->setAuthcode(sfConfig::get('app_authcode_classauth'));
                    $user->save();
                } else {
                    //get other authorizers
                    $ugyear = $user->getGraduationyear() - 2;
                    $lgyear = $user->getGraduationyear() + 2;
                    $oa = new Criteria();
                    $oa->add(UserPeer::GRADUATIONYEAR, $ugyear, Criteria::GREATER_EQUAL);
                    $oa->add(UserPeer::GRADUATIONYEAR, $lgyear, Criteria::LESS_EQUAL);
                    $oa->add(UserPeer::BRANCH_ID, $user->getBranchId());
                    $oa->addJoin(UserPeer::ID, UserrolePeer::USER_ID);
                    $oa->add(UserrolePeer::ROLE_ID, sfConfig::get('app_role_auth'));
                    $authuserspm = UserPeer::doSelect($oa);
                    //if other authorizers are available
                    if ($authuserspm) {
                        foreach ($authuserspm as $authuserpm) {
                            $toauth = $authuserpm->getEmail();
                            $mail = myUtility::sendmail($sendermail, $sendername, $sendermail, $sendername, $sendermail, $toauth, $subject, $body);
                            $user->setAuthcode(sfConfig::get('app_authcode_otherauth'));
                            $user->save();
                        }
                    } else {
                        // no authorizers were available, send to master list of authorizers
                        $ma = new Criteria();
                        $ma->addJoin(UserPeer::ID, UserrolePeer::USER_ID);
                        $ma->add(UserrolePeer::ROLE_ID, sfConfig::get('app_role_masterauth'));
                        $mauths = UserPeer::doSelect($ma);
                        if ($mauths) {
                            foreach ($mauths as $mauth) {
                                $toauth = $mauth->getEmail();
                                $mail = myUtility::sendmail($sendermail, $sendername, $sendermail, $sendername, $sendermail, $toauth, $subject, $body);
                                $user->setAuthcode(sfConfig::get('app_authcode_masterauth'));
                                $user->save();
                            }
                        } else {
                            $user->setAuthcode(sfConfig::get('app_authcode_none'));
                            $user->save();
                        }
                    }
                }
                $sendermail = sfConfig::get('app_from_mail');
                $sendername = sfConfig::get('app_from_name');
                $to = $email;
                $subject = "Registration request for ITBHU Global Org";
                $body = '
				Dear ' . $user->getFullname() . ',
				
				Thank you for your connect request. We\'ll get back to you shortly.	
				
				
				Admin,
				ITBHU Global
				';
                $mail = myUtility::sendmail($sendermail, $sendername, $sendermail, $sendername, $sendermail, $to, $subject, $body);
            }
        }
        // saving the checkbox data in db
        $c = new Criteria();
        $c->add(PersonalPeer::USER_ID, $user->getId());
        $this->personal = PersonalPeer::doSelectOne($c);
        $c = new Criteria();
        $worktypes = WorktypePeer::doSelect($c);
        foreach ($worktypes as $worktype) {
            if ($this->getRequestParameter($worktype->getId())) {
                $personalWorktype = new PersonalWorktype();
                $personalWorktype->setPersonalId($this->personal->getId());
                $personalWorktype->setWorktypeId($worktype->getId());
                $personalWorktype->save();
            }
        }
    }
 public static function doSelectJoinAllExceptSubdistrict(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     NgTestApplicantParentsPeer::addSelectColumns($c);
     $startcol2 = NgTestApplicantParentsPeer::NUM_COLUMNS - NgTestApplicantParentsPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     NgTestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + NgTestApplicantPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     DegreePeer::addSelectColumns($c);
     $startcol5 = $startcol4 + DegreePeer::NUM_COLUMNS;
     SalaryPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SalaryPeer::NUM_COLUMNS;
     JobTypePeer::addSelectColumns($c);
     $startcol7 = $startcol6 + JobTypePeer::NUM_COLUMNS;
     CountryPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + CountryPeer::NUM_COLUMNS;
     RegionPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + RegionPeer::NUM_COLUMNS;
     CityPeer::addSelectColumns($c);
     $startcol10 = $startcol9 + CityPeer::NUM_COLUMNS;
     DistrictPeer::addSelectColumns($c);
     $startcol11 = $startcol10 + DistrictPeer::NUM_COLUMNS;
     $c->addJoin(NgTestApplicantParentsPeer::NG_TEST_APPLICANT_ID, NgTestApplicantPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::DEGREE_ID, DegreePeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::SALARY_ID, SalaryPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::JOB_TYPE_ID, JobTypePeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::COUNTRY_ID, CountryPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::CITY_ID, CityPeer::ID);
     $c->addJoin(NgTestApplicantParentsPeer::DISTRICT_ID, DistrictPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = NgTestApplicantParentsPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = NgTestApplicantPeer::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->getNgTestApplicant();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initNgTestApplicantParentss();
             $obj2->addNgTestApplicantParents($obj1);
         }
         $omClass = ReligionPeer::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->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initNgTestApplicantParentss();
             $obj3->addNgTestApplicantParents($obj1);
         }
         $omClass = DegreePeer::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->getDegree();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initNgTestApplicantParentss();
             $obj4->addNgTestApplicantParents($obj1);
         }
         $omClass = SalaryPeer::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->getSalary();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initNgTestApplicantParentss();
             $obj5->addNgTestApplicantParents($obj1);
         }
         $omClass = JobTypePeer::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->getJobType();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initNgTestApplicantParentss();
             $obj6->addNgTestApplicantParents($obj1);
         }
         $omClass = CountryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj7 = new $cls();
         $obj7->hydrate($rs, $startcol7);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj7 = $temp_obj1->getCountry();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initNgTestApplicantParentss();
             $obj7->addNgTestApplicantParents($obj1);
         }
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj8 = new $cls();
         $obj8->hydrate($rs, $startcol8);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj8 = $temp_obj1->getRegion();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initNgTestApplicantParentss();
             $obj8->addNgTestApplicantParents($obj1);
         }
         $omClass = CityPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj9 = new $cls();
         $obj9->hydrate($rs, $startcol9);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj9 = $temp_obj1->getCity();
             if ($temp_obj9->getPrimaryKey() === $obj9->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj9->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj9->initNgTestApplicantParentss();
             $obj9->addNgTestApplicantParents($obj1);
         }
         $omClass = DistrictPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj10 = new $cls();
         $obj10->hydrate($rs, $startcol10);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj10 = $temp_obj1->getDistrict();
             if ($temp_obj10->getPrimaryKey() === $obj10->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj10->addNgTestApplicantParents($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj10->initNgTestApplicantParentss();
             $obj10->addNgTestApplicantParents($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }