chore: Мелкие правки

This commit is contained in:
origami11@yandex.ru 2025-11-27 13:45:45 +03:00
parent 0473d410d1
commit 3e0b99c3d2
4 changed files with 9 additions and 21 deletions

View file

@ -48,25 +48,14 @@ class Service
return Path::join($this->webPath[0], strtolower(get_class($this)), 'templates', 'modern');
}
/**
* @param string $name Имя модели
* @return string
*/
private function getModelPath($name)
{
return Path::join ($this->config->get('system', 'path'), "model", $name . ".php");
}
/**
* Создает модель
* @param string $name
* @param class-string $modelName
* @return BaseMapper
*/
public function getModel($name)
public function getModel($modelName)
{
require_once ($this->getModelPath ($name));
$modelName = $name . "Mapper";
$model = new $modelName ();
$model = new $modelName();
$model->db = $this->db;
return $model;
}