public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = VCourseSessionPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setSubjectAccalId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setSubjectCurrId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setEmployeeId($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setClassGroupId($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setLocationId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setDay($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setClassSessionId($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setAcademicCalendarId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setSessionLength($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setCourseScheduleId($arr[$keys[10]]); } }
public function getVCourseSessionsJoinCourseSchedule($criteria = null, $con = null) { include_once 'lib/model/om/BaseVCourseSessionPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVCourseSessions === null) { if ($this->isNew()) { $this->collVCourseSessions = array(); } else { $criteria->add(VCourseSessionPeer::EMPLOYEE_ID, $this->getId()); $this->collVCourseSessions = VCourseSessionPeer::doSelectJoinCourseSchedule($criteria, $con); } } else { $criteria->add(VCourseSessionPeer::EMPLOYEE_ID, $this->getId()); if (!isset($this->lastVCourseSessionCriteria) || !$this->lastVCourseSessionCriteria->equals($criteria)) { $this->collVCourseSessions = VCourseSessionPeer::doSelectJoinCourseSchedule($criteria, $con); } } $this->lastVCourseSessionCriteria = $criteria; return $this->collVCourseSessions; }
public static function retrieveByPK($id, $session_length, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $criteria = new Criteria(); $criteria->add(VCourseSessionPeer::ID, $id); $criteria->add(VCourseSessionPeer::SESSION_LENGTH, $session_length); $v = VCourseSessionPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }