mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-11-18 21:35:12 +00:00
WEB: Add new Models and Objects to support the new data files
This commit is contained in:
1 parent
c6207590c9
commit
a75a6c70ee
11 files changed
+333
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace ScummVM\Models;
|
||||
|
||||
use ScummVM\Objects\Engine;
|
||||
|
||||
/**
|
||||
* The EnginesModel is used to cross reference Engines across the website
|
||||
*/
|
||||
abstract class EnginesModel extends BasicModel
|
||||
{
|
||||
/* Get all Engines from YAML */
|
||||
public static function getAllEngines()
|
||||
{
|
||||
$fname = DIR_DATA . '/engines.yaml';
|
||||
$engines = \yaml_parse_file($fname);
|
||||
$data = [];
|
||||
foreach ($engines as $engine) {
|
||||
$obj = new Engine($engine);
|
||||
$data[$obj->getId()] = $obj;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user