name)) { $this->name = $data->name; } if(!empty($data->version)) { $this->version = $data->version; } // @ToDo check Enum if(!empty($data->category)) { $this->category = $data->category; } if(!empty($data->icon)) { $this->icon = $data->icon; } if(!empty($data->order)) { $this->order = $data->order; } if(!empty($data->description)) { $this->description = $data->description; } if(!empty($data->author)) { $this->author = new ModuleAuthor($data->author); } if(!empty($data->repository)) { $this->repository = $data->repository; } $this->is_valid = true; } public function isValid() { return $this->is_valid; } public function getName() { return $this->name; } public function getVersion() { return $this->version; } public function getCategory() { return $this->category; } public function getOrder() { return $this->order; } public function getIcon($raw = false) { if($raw) { return $this->icon; } // @ToDo If starts with http/https or slash or base64 return sprintf('%s', $this->icon); } public function getDescription() { return $this->description; } public function getAuthor() { return $this->author; } public function getRepository() { return $this->repository; } } ?>