You are here

class QueryResultTableFormatter in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Commands/QueryResultTableFormatter.php \Drupal\salesforce\Commands\QueryResultTableFormatter
  2. 5.0.x src/Commands/QueryResultTableFormatter.php \Drupal\salesforce\Commands\QueryResultTableFormatter

Format QueryResult metadata.

Hierarchy

  • class \Drupal\salesforce\Commands\QueryResultTableFormatter extends \Consolidation\OutputFormatters\Formatters\TableFormatter

Expanded class hierarchy of QueryResultTableFormatter

1 file declares its use of QueryResultTableFormatter
SalesforceMappingCommandsBase.php in modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php

File

src/Commands/QueryResultTableFormatter.php, line 12

Namespace

Drupal\salesforce\Commands
View source
class QueryResultTableFormatter extends TableFormatter {

  /**
   * {@inheritdoc}
   */
  public function validDataTypes() {
    return [
      new \ReflectionClass('\\Drupal\\salesforce\\Commands\\QueryResult'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function writeMetadata(OutputInterface $output, $query, FormatterOptions $options) {
    $output
      ->writeln(str_pad(' ', 10 + strlen($query
      ->getPrettyQuery()), '-'));
    $output
      ->writeln(dt('  Size: !size', [
      '!size' => $query
        ->getSize(),
    ]));
    $output
      ->writeln(dt('  Total: !total', [
      '!total' => $query
        ->getTotal(),
    ]));
    $output
      ->writeln(dt('  Query: !query', [
      '!query' => $query
        ->getPrettyQuery(),
    ]));
  }

}

Members