diff options
Diffstat (limited to 'public/app/extends/App_user.php')
| -rw-r--r-- | public/app/extends/App_user.php | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/public/app/extends/App_user.php b/public/app/extends/App_user.php new file mode 100644 index 0000000..9aed489 --- /dev/null +++ b/public/app/extends/App_user.php @@ -0,0 +1,121 @@ +<?php +namespace app\extends; + +use User; +use Registry; + + +/** Classroom_user + * + * extends (anom's) User + * + * this way it specializes the UserManagement + * according to this app's special rules + * + * Add privileges concept + * --- + * A Class_user has privileges (which are deferent than Roles) + * In fact, privileges extend the authorization requirements for users + * + * Authorized content is marked with some 'minimum Privilege' + * So the content is available to the READER(s) that have certain Privileges + * + */ +class App_user extends User +{ + + /** user id + * @var int + */ + private $id; + + /** user privileges + * @var array + */ + private $privileges = []; + + /** user name + * @var string + */ + private $name; + + /** SETTERS AND GETTERS + * for id, name, privileges attributes + * ------------------------------------------------------------------------- + */ + + // id + // --- -- -- - - - + + /** getID + * @return int + */ + public function getID(): int + { + return $this->id; + } + + /** setID() + * + * @param int : user id + * + * @return User + */ + public function setID(int $id): self + { + $this->id = $id; + return $this; + } + + + // name + // --- -- -- - - - + + /** getName + * @return int + */ + public function getName(): string + { + return $this->name; + } + + /** setName() + * + * @param string : user's full name + * + * @return User + */ + public function setName(string $name): self + { + $this->name = $name; + return $this; + } + + + // privileges + // --- -- -- - - - + + /** getPrivileges + * + * @return privileges (array) + */ + public function getPrivileges(): array + { + return $this->privileges; + } + + + /** setPrivileges() + * + * @param array $privileges + * + * @return User + */ + public function setPrivileges(array $privileges): self + { + $this->privileges = $privileges; + return $this; + } + + +}
\ No newline at end of file |
