private function refreshCache(Student $student, $term)
 {
     // Store the core data
     $db = new PHPWS_DB('hms_student_cache');
     $db->addWhere('username', $student->getUsername());
     $db->addWhere('banner_id', $student->getBannerId());
     $db->addWhere('term', $term);
     $result = $db->delete();
     // Silently log any errors
     PHPWS_Error::logIfError($result);
     $db->reset();
     $student = CachedStudent::toCachedStudent($student);
     $student->save($term);
     // Silently log any errors
     PHPWS_Error::logIfError($result);
     // Store the addresses
     self::setAddresses($student);
     // Store the phone numbers
     self::setPhoneNumbers($student);
 }
示例#2
0
 public static function toCachedStudent(Student $student)
 {
     $varsArray = get_object_vars($student);
     return CachedStudent::plugData($varsArray);
 }