You are here

interface ReportTypeInterface in Commerce Reporting 8

Defines the interface for order report types.

Hierarchy

Expanded class hierarchy of ReportTypeInterface

All classes that implement ReportTypeInterface

1 file declares its use of ReportTypeInterface
ReportQueryBuilder.php in src/ReportQueryBuilder.php

File

src/Plugin/Commerce/ReportType/ReportTypeInterface.php, line 12

Namespace

Drupal\commerce_reports\Plugin\Commerce\ReportType
View source
interface ReportTypeInterface extends BundlePluginInterface {

  /**
   * Gets the order report type label.
   *
   * @return string
   *   The order report type label.
   */
  public function getLabel();

  /**
   * Gets the order report type description.
   *
   * @return string
   *   The order report type description.
   */
  public function getDescription();

  /**
   * Builds the aggregate query.
   *
   * Report type plugins should add their field columns, aggregates, and
   * groupBy statements here.
   *
   * @param \Drupal\Core\Entity\Query\QueryAggregateInterface $query
   *   The aggregate query.
   */
  public function buildQuery(QueryAggregateInterface $query);

  /**
   * Build a report table from query results.
   *
   * @param array $results
   *   The report query results.
   *
   * @return array
   *   The render array.
   */
  public function buildReportTable(array $results);

  /**
   * Generates order reports for an order.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   */
  public function generateReports(OrderInterface $order);

  /**
   * Creates a new order report using the given order and values.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param array $values
   *   (optional) An array of values to set, keyed by property name.
   */
  public function createFromOrder(OrderInterface $order, array $values = []);

}

Members

Namesort descending Modifiers Type Description Overrides
BundlePluginInterface::buildFieldDefinitions public function Builds the field definitions for entities of this bundle. 2
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ReportTypeInterface::buildQuery public function Builds the aggregate query. 4
ReportTypeInterface::buildReportTable public function Build a report table from query results. 1
ReportTypeInterface::createFromOrder public function Creates a new order report using the given order and values. 1
ReportTypeInterface::generateReports public function Generates order reports for an order. 4
ReportTypeInterface::getDescription public function Gets the order report type description. 1
ReportTypeInterface::getLabel public function Gets the order report type label. 1