Example #1
0
 public static function retrieveBySubjectCurr($id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria(VSubjectStudentPeer::DATABASE_NAME);
     $criteria->add(VSubjectStudentPeer::SUBJECT_CURR_ID, $id);
     $v = VSubjectStudentPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }
 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(VSubjectStudentPeer::ID, $pks, Criteria::IN);
         $objs = VSubjectStudentPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = VSubjectStudentPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setStudentId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setCurriculumId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setCode($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setSubjectId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setCredit($arr[$keys[5]]);
     }
 }
Example #4
0
 public function executeShowScore()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $id = $this->getRequestParameter('id');
     $subject_curr = VSubjectStudentPeer::retrieveByPk($id);
     $this->forward404Unless($subject_curr);
     $this->subtitle = $subject_curr->toString() . ' - id:' . $subject_curr->getId();
     $actions = array(array('name' => 'back', 'url' => 'score_final/listScore?student_id=' . $subject_curr->getStudentId(), 'color' => 'green'));
     $this->actions = $actions;
     $this->subject_curr = $subject_curr;
 }