adminUser = $adminUser;
parent::__construct($name);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$adminUserName = $input->getArgument(self::ARGUMENT_ADMIN_USERNAME);
$userData = $this->adminUser->loadByUsername($adminUserName);
$outputMessage = sprintf('Couldn\'t find the user account "%s"', $adminUserName);
if ($userData) {
if (isset($userData[self::USER_ID]) && $this->adminUser->unlock($userData[self::USER_ID])) {
$outputMessage = sprintf('The user account "%s" has been unlocked', $adminUserName);
} else {
$outputMessage = sprintf(
'The user account "%s" was not locked or could not be unlocked',
$adminUserName
);
}
}
$output->writeln('' . $outputMessage . '');
}
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setName(self::COMMAND_ADMIN_ACCOUNT_UNLOCK);
$this->setDescription(self::COMMAND_DESCRIPTION);
$this->addArgument(
self::ARGUMENT_ADMIN_USERNAME,
InputArgument::REQUIRED,
self::ARGUMENT_ADMIN_USERNAME_DESCRIPTION
);
$this->setHelp(
<<%command.full_name% username
HELP
);
parent::configure();
}
}