mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
namespace ScummVM\Objects;
|
|
|
|
/**
|
|
* The BasicSection class is inherited by all other Sections and houses all common
|
|
* functions.
|
|
*/
|
|
abstract class BasicSection extends BasicObject
|
|
{
|
|
protected $title;
|
|
protected $anchor;
|
|
protected $subsections;
|
|
private $className;
|
|
|
|
public function __construct($data)
|
|
{
|
|
parent::__construct($data);
|
|
$this->title = $data['title'];
|
|
$this->anchor = $data['anchor'];
|
|
$this->className = static::class;
|
|
$this->subsections = array();
|
|
if (isset($data['subsection'])) {
|
|
parent::toArray($data['subsection']);
|
|
foreach ($data['subsection'] as $value) {
|
|
$this->subsections[] = new $this->className($value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Get the title. */
|
|
public function getTitle()
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
/* Get the anchor. */
|
|
public function getAnchor()
|
|
{
|
|
return $this->anchor;
|
|
}
|
|
|
|
/* Get the optional list of subsections. */
|
|
public function getSubSections()
|
|
{
|
|
return $this->subsections;
|
|
}
|
|
}
|