Camspiers\StatisticalClassifier\Model\CachedModel::__construct PHP Метод

__construct() публичный Метод

Create the CachedModel using the modelname, cache and datasource
public __construct ( string $modelName, CacheCache\Cache $cache )
$modelName string The name of the model
$cache CacheCache\Cache The cache to use
    public function __construct($modelName, Cache $cache)
    {
        $this->modelName = $modelName;
        $this->cache = $cache;
        $data = $this->cache->get($this->modelName);
        if ($data !== null) {
            $this->prepared = true;
            $this->model = $data;
        }
    }