Example #1
0
 public function __construct(Student $student, HMS_Bed $bed, $term, $checkinBy, $keyCode)
 {
     $this->setBannerId($student->getBannerId());
     $this->setBedPersistentId($bed->getPersistentId());
     $this->setBedId($bed->getId());
     $this->setTerm($term);
     $this->setRoomId($bed->get_parent()->getId());
     $this->setCheckinDate(time());
     $this->setCheckinby($checkinBy);
     $this->setKeyCode($keyCode);
 }
Example #2
0
 public static function getCheckinByBed(Student $student, HMS_Bed $bed)
 {
     $db = new PHPWS_DB('hms_checkin');
     $db->addWhere('banner_id', $student->getBannerId());
     //$db->addWhere('term', $term);
     //$db->addWhere('bed_id', $bed->getId());
     $db->addWhere('bed_persistent_id', $bed->getPersistentId());
     $checkin = new RestoredCheckin();
     $result = $db->loadObject($checkin);
     if (PHPWS_Error::logIfError($result)) {
         throw new DatabaseException($result->toString());
     }
     if ($checkin->getId() == null) {
         return null;
     }
     return $checkin;
 }