From a91c916248f967da2d4218b575e665242b7c975b Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 25 Oct 2018 20:25:05 +0200 Subject: phoenixreborn\'NWY --- w/class/user.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 w/class/user.php (limited to 'w/class/user.php') diff --git a/w/class/user.php b/w/class/user.php new file mode 100644 index 0000000..3ed831d --- /dev/null +++ b/w/class/user.php @@ -0,0 +1,37 @@ +hydrate($datas); + } + } + + public function hydrate(array $datas = []) + { + foreach ($datas as $key => $value) { + $method = 'set' . $key; + + if (method_exists($this, $method)) { + $this->$method($value); + } + } + } + + public function setlevel($level) + { + $this->level = $level; + } + + public function level() + { + return $this->level; + } +} + + + +?> \ No newline at end of file -- cgit v1.2.3