Files
scummvm-web/include/Objects/DownloadsSection.php
2019-01-23 05:18:28 -05:00

54 lines
1.3 KiB
PHP

<?php
namespace ScummVM\Objects;
/**
* The DownloadsSection object represents a section on the downloads page.
*/
class DownloadsSection extends BasicSection
{
private $notes;
private $footer;
private $files;
private $links;
private $items;
private $baseUrl;
public function __construct($data)
{
parent::__construct($data);
$this->notes = $data['notes'];
$this->items = array();
if (isset($data['baseurl'])) {
$this->baseUrl = $data['baseurl'];
}
if (isset($data['entries'])) {
foreach ($data['entries'] as $type => $item) {
parent::toArray($item);
if ($type == 'file') {
foreach ($item as $file) {
$this->items[] = new File($file, $this->baseUrl);
}
} elseif ($type == 'link') {
foreach ($item as $link) {
$this->items[] = new WebLink($link);
}
}
}
}
}
/* Get the optional notes. */
public function getNotes()
{
return $this->notes;
}
/* Get the list of items. */
public function getItems()
{
return $this->items;
}
}