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

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

public __construct ( $modelFilename, CacheCache\Cache $cache )
$modelFilename
$cache CacheCache\Cache
    public function __construct($modelFilename, Cache $cache)
    {
        $this->modelFilename = $modelFilename;
        $this->cache = $cache;
        $data = $this->cache->get($modelFilename);
        if ($data !== null && file_exists($this->modelFilename)) {
            $this->model = new \SVMModel();
            $this->model->load($this->modelFilename);
            $this->categoryMap = $data['categoryMap'];
            $this->tokenMap = $data['tokenMap'];
            $this->prepared = true;
        }
    }