diff --git a/include/Models/CompaniesModel.php b/include/Models/CompaniesModel.php new file mode 100644 index 00000000..c593f8b3 --- /dev/null +++ b/include/Models/CompaniesModel.php @@ -0,0 +1,23 @@ +getId()] = $obj; + } + return $data; + } +} diff --git a/include/Models/EnginesModel.php b/include/Models/EnginesModel.php new file mode 100644 index 00000000..b66a8f3c --- /dev/null +++ b/include/Models/EnginesModel.php @@ -0,0 +1,23 @@ +getId()] = $obj; + } + return $data; + } +} diff --git a/include/Models/GameModel.php b/include/Models/GameModel.php new file mode 100644 index 00000000..96c0e01a --- /dev/null +++ b/include/Models/GameModel.php @@ -0,0 +1,23 @@ +getId()] = $obj; + } + return $data; + } +} diff --git a/include/Models/PlatformsModel.php b/include/Models/PlatformsModel.php new file mode 100644 index 00000000..59334be0 --- /dev/null +++ b/include/Models/PlatformsModel.php @@ -0,0 +1,23 @@ +getId()] = $obj; + } + return $data; + } +} diff --git a/include/Models/VersionsModel.php b/include/Models/VersionsModel.php new file mode 100644 index 00000000..d1015d82 --- /dev/null +++ b/include/Models/VersionsModel.php @@ -0,0 +1,23 @@ +getId()] = $obj; + } + return $data; + } +} diff --git a/include/Objects/Company.php b/include/Objects/Company.php new file mode 100644 index 00000000..42e306e3 --- /dev/null +++ b/include/Objects/Company.php @@ -0,0 +1,32 @@ +name = $data['name']; + $this->alt_name = $data['alt_name']; + } + + /* Get the company name. */ + public function getName() + { + return $this->name; + } + + /* Get the alternative name */ + public function getAltName() + { + return $this->alt_name; + } +} diff --git a/include/Objects/DataObject.php b/include/Objects/DataObject.php new file mode 100644 index 00000000..25cddca3 --- /dev/null +++ b/include/Objects/DataObject.php @@ -0,0 +1,44 @@ +id = $data['id']; + } elseif (array_key_exists('support', $data)) { // Compatibility + $this->id = join("_",[$data['game_id'],$data['version']]); + } + } + + /* Get the ID. */ + public function getId() + { + return $this->id; + } + + public function getDescription() + { + return $this->description; + } + + /** + * If the input array doesn't contain the numerical key 0, wrap it inside + * an array. This functions operates on the data directly. + * + * @param mixed $data the input + */ + public static function toArray(&$data) + { + if (!is_array($data) || !array_key_exists(0, $data)) { + $data = array($data); + } + } +} diff --git a/include/Objects/Engine.php b/include/Objects/Engine.php new file mode 100644 index 00000000..0c611187 --- /dev/null +++ b/include/Objects/Engine.php @@ -0,0 +1,40 @@ +name = $data['name']; + $this->alt_name = $data['alt_name']; + $this->enabled = $data['enabled']; + } + + /* 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; + } + +} diff --git a/include/Objects/Game.php b/include/Objects/Game.php new file mode 100644 index 00000000..ab1c33bb --- /dev/null +++ b/include/Objects/Game.php @@ -0,0 +1,56 @@ +name = $data['name']; + $this->engine = $data['engine_id']; + $this->company = $data['company_id']; + $this->moby_id = $data['moby_id']; + $this->datafiles = $data['datafiles']; + } + + /* Get the game name. */ + public function getName() + { + return $this->name; + } + + /* Get the ScummVM engine name */ + public function getEngine() + { + return $this->engine; + } + + /* Get the company who made the game */ + public function getCompany() + { + return $this->company; + } + + /* Get the mobygames id. */ + public function getMobyId() + { + return $this->moby_id; + } + + /* Get the link to the game datafiles. */ + public function getDatafiles() + { + return $this->datafiles; + } + +} diff --git a/include/Objects/Platform.php b/include/Objects/Platform.php new file mode 100644 index 00000000..eceee003 --- /dev/null +++ b/include/Objects/Platform.php @@ -0,0 +1,23 @@ +name = $data['name']; + } + + /* Get the platform name. */ + public function getName() + { + return $this->name; + } +} diff --git a/include/Objects/Version.php b/include/Objects/Version.php new file mode 100644 index 00000000..f1ab1c64 --- /dev/null +++ b/include/Objects/Version.php @@ -0,0 +1,23 @@ +date = $data['date']; + } + + /* Get the version release name. */ + public function getDate() + { + return $this->date; + } +}