/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }