diff --git a/src/system/Model.php b/src/system/Model.php index a59b03d..b0a9ab6 100644 --- a/src/system/Model.php +++ b/src/system/Model.php @@ -11,7 +11,6 @@ class Model { public $contents = []; public $model = []; - public $required_fields = []; public function __construct($records) { @@ -78,8 +77,6 @@ protected function listContents($record): StdClass $Content->$section_value = $this->section($content_section, $section_key); } - $this->validate($Content); - return $Content; } @@ -115,19 +112,4 @@ public function section(string $content_section, $section_key): StdClass return $Section; } - - - public function validate($Content) - { - foreach ($this->required_fields as $section => $fields) { - if (!property_exists($Content, $section)) { - throw new Exception("Required section '$section' missing in content."); - } - foreach ($fields as $field) { - if (!property_exists($Content->$section, $field)) { - throw new Exception("Required $section field '$field' missing in content."); - } - } - } - } }