summaryrefslogtreecommitdiff
path: root/public/app/extends/App_user.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-24 05:06:01 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-24 05:06:01 +0300
commit63dc17d0abc398c135f6d049d28174c3925416c9 (patch)
tree3c68552b737096b073368ac8d874b0cd46640adb /public/app/extends/App_user.php
parent2f5f034a97fd39b372d9c23b1b04db74c4469f22 (diff)
downloadgyraf1gov-63dc17d0abc398c135f6d049d28174c3925416c9.tar.gz
gyraf1gov-63dc17d0abc398c135f6d049d28174c3925416c9.tar.bz2
gyraf1gov-63dc17d0abc398c135f6d049d28174c3925416c9.zip
forming default values for auto fields
Diffstat (limited to 'public/app/extends/App_user.php')
-rw-r--r--public/app/extends/App_user.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/public/app/extends/App_user.php b/public/app/extends/App_user.php
index 6e93969..bb3d61d 100644
--- a/public/app/extends/App_user.php
+++ b/public/app/extends/App_user.php
@@ -31,6 +31,21 @@ class App_user extends User
*/
private $name;
+ /** other properties
+ * to keep near-by for easy access
+ * all @var string
+ */
+ private $prifix;
+ private $first_name;
+ private $last_name;
+ private $father_name;
+ private $registration_number;
+ private $email;
+ private $sector;
+ private $belonging_school;
+ private $position;
+
+
/** SETTERS AND GETTERS
@@ -111,6 +126,61 @@ class App_user extends User
return $this;
}
+
+ // all other properties
+ // --- -- -- - - -
+
+ /** set
+ * general seter for all other properties
+ *
+ * @param $prop (string): property name
+ * @param $val (string): property value
+ * @return this (object)
+ */
+ public function set(string $prop, string $val)
+ {
+ switch ($prop) {
+ case 'prefix': $this->prefix = $val; return $this; break;
+ case 'first_name': $this->first_name = $val; return $this; break;
+ case 'last_name': $this->last_name = $val; return $this; break;
+ case 'father_name': $this->father_name = $val; return $this; break;
+ case 'email': $this->email = $val; return $this; break;
+ case 'sector': $this->sector = $val; return $this; break;
+ case 'position': $this->position = $val; return $this; break;
+ case 'registration_number':
+ $this->registration_number = $val; return $this; break;
+ case 'belonging_school':
+ $this->belonging_school = $val; return $this; break;
+
+ default:
+ return $this;
+ }
+ }
+
+
+ /** get
+ * general getter for all properties
+ *
+ * @param $prop (string): property name
+ * @return (string): property value (or null if propety not exists)
+ */
+ public function get(string $prop)
+ {
+ switch ($prop) {
+ case 'prefix': return $this->prefix; break;
+ case 'first_name': return $this->first_name; break;
+ case 'last_name': return $this->last_name; break;
+ case 'father_name': return $this->father_name; break;
+ case 'email': return $this->email; break;
+ case 'sector': return $this->sector; break;
+ case 'position': return $this->position; break;
+ case 'registration_number': return $this->registration_number; break;
+ case 'belonging_school': return $this->belonging_school; break;
+
+ default:
+ return null;
+ }
+ }
} \ No newline at end of file