mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
30 lines
653 B
PHP
30 lines
653 B
PHP
<?php
|
|
namespace ScummVM\Models;
|
|
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
|
/**
|
|
* The SimpleModel is used automatically create simple models
|
|
* that do not require any special handling
|
|
*/
|
|
class SimpleModel extends BasicModel
|
|
{
|
|
private $query;
|
|
|
|
public function __construct($type)
|
|
{
|
|
parent::__construct();
|
|
$this->query = "ScummVM\OrmObjects\\{$type}Query::create" ;
|
|
}
|
|
|
|
public function getAllData()
|
|
{
|
|
$objects = $this->getFromCache();
|
|
if (is_null($objects)) {
|
|
$objects = ($this->query)()->find();
|
|
$this->saveToCache($objects, $this->type);
|
|
}
|
|
return $objects;
|
|
}
|
|
}
|