chore: Мелкие правки
This commit is contained in:
parent
0473d410d1
commit
3e0b99c3d2
4 changed files with 9 additions and 21 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue