Files
scummvm-web/include/Objects/Engine.php
T
Mataniko 4d78399ea2 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
2020-09-27 22:08:07 -04:00

41 lines
873 B
PHP

<?php
namespace ScummVM\Objects;
/**
* The Engine object represents a game engine supported by ScummVM
*/
class Engine extends DataObject
{
private $name;
private $alt_name;
private $enabled;
/* Article object constructor. */
public function __construct($data)
{
parent::__construct($data);
$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. */
public function getName()
{
return $this->name;
}
/* Get the alternative name */
public function getAltName()
{
return $this->alt_name;
}
/* Get the engine enabled status. */
public function getEnabled()
{
return $this->enabled;
}
}