aboutsummaryrefslogtreecommitdiff
path: root/app/class/User.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-01-29 02:34:50 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-01-29 02:34:50 +0100
commit64ac1605b6fe8e997134dd57cc30f30b99ebc076 (patch)
treed4fd89c68f0f0eb7b49ea92336f8f8ab5f778e45 /app/class/User.php
parentb6173772bdef1eaf067573373ab500d67dfc454d (diff)
downloadwcms-64ac1605b6fe8e997134dd57cc30f30b99ebc076.tar.gz
wcms-64ac1605b6fe8e997134dd57cc30f30b99ebc076.zip
refactor : item abstract class
new Item abstract class with hydrate and dry functions to clean others
Diffstat (limited to 'app/class/User.php')
-rw-r--r--app/class/User.php23
1 files changed, 1 insertions, 22 deletions
diff --git a/app/class/User.php b/app/class/User.php
index 8712c72..b735309 100644
--- a/app/class/User.php
+++ b/app/class/User.php
@@ -5,7 +5,7 @@ namespace Wcms;
use DateTimeImmutable;
use DateTimeZone;
-class User
+class User extends Item
{
protected $id;
protected $level = 0;
@@ -26,27 +26,6 @@ class User
}
}
- public function hydrate($datas = [])
- {
- foreach ($datas as $key => $value) {
- $method = 'set' . $key;
-
- if (method_exists($this, $method)) {
- $this->$method($value);
- }
- }
- }
-
- public function dry()
- {
- $array = [];
- foreach (get_class_vars(__class__) as $var => $value) {
- $array[$var] = $this->$var();
- }
- return $array;
- }
-
-
// _________________________ G E T _______________________
public function id()