You are here

protected function GetValueCommand::execute in Config Pages 8.3

Same name and namespace in other branches
  1. 8.2 src/Command/GetValueCommand.php \Drupal\config_pages\Command\GetValueCommand::execute()

File

src/Command/GetValueCommand.php, line 66

Class

GetValueCommand
Class GetValueCommand.

Namespace

Drupal\config_pages\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  $bundle = $input
    ->getArgument('bundle');
  $field_name = $input
    ->getArgument('field_name');
  $context = $input
    ->getArgument('context');
  try {
    $config_page = config_pages_config($bundle, $context);
    if (!empty($config_page)) {
      $output
        ->writeln($config_page
        ->get($field_name)->value);
    }
  } catch (\Exception $e) {
    $this->logger
      ->error($e
      ->getMessage());
  }
}