public function commands()
{
return array(
- new \IPF\Auth\Commands\CreateSuperUser($this, $this->container['auth_service']),
+ new \IPF\Auth\Commands\CreateSuperUser($this, $this->container['auth_service'], $this->getConnection()),
);
}
namespace IPF\Auth\Commands;
+use Doctrine\DBAL\Connection;
use IPF\Auth\AuthService;
class CreateSuperUser
private $auth_app;
/** @var AuthService */
private $auth_service;
+ /** @var Connection */
+ private $connection;
- public function __construct(\IPF_Auth_App $auth_app, AuthService $auth_service)
+ public function __construct(\IPF_Auth_App $auth_app, AuthService $auth_service, Connection $connection)
{
$this->auth_app = $auth_app;
$this->auth_service = $auth_service;
+ $this->connection = $connection;
}
public function run($args=null)
$su->is_active = true;
$su->is_superuser = true;
$this->auth_service->setPassword($su, $password);
- $su->save();
+ $su->save($this->connection);
print "Done\n";
}
}