mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-06-20 05:45:49 +00:00
Since it appears that #110 will require compatibility data to be changed from XML to YAML, I wanted to practice and change a simpler page from XML to YAML. If merged, I'm willing to convert other pages as well (e.g. Links, Press Articles, Screenshots, FAQs) as well
32 lines
853 B
PHP
32 lines
853 B
PHP
<?php
|
|
namespace ScummVM\Models;
|
|
|
|
use ScummVM\Objects\GameDemo;
|
|
|
|
/**
|
|
* The GameDemosModel class will generate GameDemo objects.
|
|
*/
|
|
abstract class GameDemosModel extends BasicModel
|
|
{
|
|
/* Get all the groups and their respective demos. */
|
|
public static function getAllGroupsAndDemos()
|
|
{
|
|
$fname = DIR_DATA . '/game_demos.yaml';
|
|
$a = \yaml_parse_file($fname);
|
|
$entries = array();
|
|
$entries = array();
|
|
foreach ($a['game_demos']['group'] as $key => $value) {
|
|
$demos = array();
|
|
foreach ($value['demos'] as $data) {
|
|
$demos[] = new GameDemo($data);
|
|
}
|
|
$entries[] = array(
|
|
'name' => $value['name'],
|
|
'href' => $value['href'],
|
|
'demos' => $demos,
|
|
);
|
|
}
|
|
return $entries;
|
|
}
|
|
}
|