class_Guest.php

Go to the documentation of this file.
00001 <?php
00024 class Guest extends BaseUser implements ManageableGuest, Registerable {
00025         // Exceptions
00026         const EXCEPTION_USERNAME_NOT_FOUND   = 0x170;
00027         const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x171;
00028         const EXCEPTION_USER_PASS_MISMATCH   = 0x172;
00029 
00035         protected function __construct () {
00036                 // Call parent constructor
00037                 parent::__construct(__CLASS__);
00038         }
00039 
00049         public final static function createGuestByUsername ($userName) {
00050                 // Get a new instance
00051                 $userInstance = new Guest();
00052 
00053                 // Set the username
00054                 $userInstance->setUserName($userName);
00055 
00056                 // Check if username exists
00057                 if ($userInstance->ifUsernameExists() === false) {
00058                         // Throw an exception here
00059                         throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
00060                 } // END - if
00061 
00062                 // Return the instance
00063                 return $userInstance;
00064         }
00065 
00073         public final static function createGuestByEmail ($email) {
00074                 // Get a new instance
00075                 $userInstance = new Guest();
00076 
00077                 // Set the username
00078                 $userInstance->setEmail($email);
00079 
00080                 // Return the instance
00081                 return $userInstance;
00082         }
00083 
00092         public function updateLastActivity (Requestable $requestInstance) {
00093                 // No activity will be logged for guest accounts
00094         }
00095 
00101         public function flushPendingUpdates () {
00102                 // No updates will be flushed to database!
00103         }
00104 }
00105 
00106 // [EOF]
00107 ?>

Generated on Mon Dec 8 01:06:46 2008 for Ship-Simulator by  doxygen 1.5.6