WEB: Add new Models and Objects to support the new data files

This commit is contained in:
Mataniko authored and Matan Bareket committed 2020-09-27 22:08:07 -04:00
1 parent c6207590c9
commit a75a6c70ee
11 files changed
+333

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
<?php
namespace ScummVM\Models;
use ScummVM\Objects\Platform;
/**
* The PlatformsModel is used to cross reference Platforms across the website
*/
abstract class PlatformsModel extends BasicModel
{
/* Get all Platforms from YAML */
public static function getAllPlatforms()
{
$fname = DIR_DATA . '/platforms.yaml';
$platforms = \yaml_parse_file($fname);
$data = [];
foreach ($platforms as $platform) {
$obj = new Platform($platform);
$data[$obj->getId()] = $obj;
}
return $data;
}
}