mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-11-18 21:35:12 +00:00
WEB: Add error handling about missing required fields
In the new data model, some field operate as keys for other parts of the model. This now performs some validations and will throw an error if fields are missing. For example: a Game must have an Engine, but does not require datafiles
This commit is contained in:
1 parent
d455741806
commit
4d78399ea2
15 files changed
+396
-376
No files matched your search
@@ -14,9 +14,9 @@ class Engine extends DataObject
|
||||
public function __construct($data)
|
||||
{
|
||||
parent::__construct($data);
|
||||
$this->name = $data['name'];
|
||||
$this->alt_name = $data['alt_name'];
|
||||
$this->enabled = $data['enabled'];
|
||||
$this->name = $this->assignFromArray('name', $data, true);
|
||||
$this->alt_name = $this->assignFromArray('alt_name', $data);
|
||||
$this->enabled = $this->assignFromArray('enabled', $data);
|
||||
}
|
||||
|
||||
/* Get the engine name. */
|
||||
|
||||
Reference in new issue
Block a user