Esempio n. 1
0
 /**
  * Gets a entry given its unique row.
  * @param array $row The database row to use.
  * @return Entry
  */
 public static function fromRow($row)
 {
     $entry = new Entry();
     $entry->row = $row;
     ObjCache::set(OBJCACHE_TYPE_ENTRY, $entry->getEntryId(), $entry);
     return $entry;
 }
Esempio n. 2
0
 /**
  * Gets a user from their database row.
  * @param array $row The user's database row.
  * @return User
  */
 public static function fromRow($row)
 {
     $user = new User();
     $user->row = $row;
     ObjCache::set(OBJCACHE_TYPE_USER, $user->getUserId(), $user);
     return $user;
 }
Esempio n. 3
0
 /**
  * Gets an attachment given its database row.
  * @param array $row
  * @return \Attachment
  */
 public static function fromRow($row)
 {
     $attachment = new Attachment();
     $attachment->row = $row;
     ObjCache::set(OBJCACHE_TYPE_ATTACHMENT, $attachment->getAttachmentId(), $attachment);
     return $attachment;
 }
Esempio n. 4
0
 /**
  * Gets a course given its unique row.
  * @param array $row The database row to use.
  * @return Course
  */
 public static function fromRow($row)
 {
     $course = new Course();
     $course->row = $row;
     ObjCache::set(OBJCACHE_TYPE_COURSE, $course->getCourseId(), $course);
     return $course;
 }
Esempio n. 5
0
 /**
  * Gets an answer given its unique row.
  * @param array $row The database row to use.
  * @return QuestionAnswer
  */
 public static function fromRow($row)
 {
     $answer = new QuestionAnswer();
     $answer->row = $row;
     ObjCache::set(OBJCACHE_TYPE_ANSWER, $answer->getAnswerId(), $answer);
     return $answer;
 }