Browse Source

Console user controller service handler

master
Egorka 6 years ago
parent
commit
31fe7fe57e
  1. 8
      console/controllers/UserController.php

8
console/controllers/UserController.php

@ -16,12 +16,12 @@ use Yii;
class UserController extends Controller
{
private $_service;
private $service;
public function __construct($id, $module, UserManageService $service, $config = [])
{
parent::__construct($id, $module, $config);
$this->_service = $service;
$this->service = $service;
}
public function actionAdd()
@ -38,7 +38,7 @@ class UserController extends Controller
$form->role = $role;
if ($form->validate()) {
$this->_service->create($form);
$this->service->create($form);
$this->stdout('Done!' . PHP_EOL);
return;
@ -59,7 +59,7 @@ class UserController extends Controller
$form->role = 'admin';
if ($form->validate()) {
$this->_service->create($form);
$this->service->create($form);
return;
}
}

Loading…
Cancel
Save