diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 23:53:59 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 23:53:59 +0100 |
commit | bbda6a710849a46de98937e85e96ea06abe333fd (patch) | |
tree | 8325563cd0e406f1f6347dc8ad29560240d16430 /framework/IUser.php | |
parent | ca22da21b0cedab985e698f4dedf3ac1158a1487 (diff) |
Once class per file: framework/*.php; removed pradolite
Diffstat (limited to 'framework/IUser.php')
-rw-r--r-- | framework/IUser.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/framework/IUser.php b/framework/IUser.php new file mode 100644 index 00000000..b8f7a6f6 --- /dev/null +++ b/framework/IUser.php @@ -0,0 +1,62 @@ +<?php +/** + * Core interfaces essential for TApplication class. + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System + */ + + +/** + * IUser interface. + * + * This interface must be implemented by user objects. + * + * @author Qiang Xue <qiang.xue@gmail.com> + * @package System + * @since 3.0 + */ +interface IUser +{ + /** + * @return string username + */ + public function getName(); + /** + * @param string username + */ + public function setName($value); + /** + * @return boolean if the user is a guest + */ + public function getIsGuest(); + /** + * @param boolean if the user is a guest + */ + public function setIsGuest($value); + /** + * @return array list of roles that the user is of + */ + public function getRoles(); + /** + * @return array|string list of roles that the user is of. If it is a string, roles are assumed by separated by comma + */ + public function setRoles($value); + /** + * @param string role to be tested + * @return boolean whether the user is of this role + */ + public function isInRole($role); + /** + * @return string user data that is serialized and will be stored in session + */ + public function saveToString(); + /** + * @param string user data that is serialized and restored from session + * @return IUser the user object + */ + public function loadFromString($string); +}
\ No newline at end of file |