From 64ac1605b6fe8e997134dd57cc30f30b99ebc076 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Wed, 29 Jan 2020 02:34:50 +0100 Subject: refactor : item abstract class new Item abstract class with hydrate and dry functions to clean others --- app/class/Element.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'app/class/Element.php') diff --git a/app/class/Element.php b/app/class/Element.php index 72eba8f..a08e219 100644 --- a/app/class/Element.php +++ b/app/class/Element.php @@ -4,7 +4,7 @@ namespace Wcms; use Exception; -class Element +class Element extends Item { protected $fullmatch; protected $type; @@ -29,17 +29,6 @@ class Element $this->analyse($pageid); } - public function hydrate($datas) - { - foreach ($datas as $key => $value) { - $method = 'set' . $key; - - if (method_exists($this, $method)) { - $this->$method($value); - } - } - } - private function analyse(string $pageid) { if(!empty($this->options)) { -- cgit v1.2.3