# disco/1.4.14/app/Analytics/Controllers/SummaryController.php

Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO, version 1.4.14. 39 lines.

- Page: https://pluginprobe.com/plugins/disco/1.4.14/code/app/Analytics/Controllers/SummaryController.php
- Raw: https://pluginprobe.com/plugins/disco/1.4.14/raw/app/Analytics/Controllers/SummaryController.php
- Modified: 2026-07-09T04:37:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disco/1.4.14/code/app/Analytics/Controllers/SummaryController.php#L10-L20`.

```php
<?php //phpcs:ignore

/**
 * SummaryController — composes the /analytics/summary response.
 *
 * @package    Disco
 * @subpackage Disco\App\Analytics\Controllers
 * @since      1.3.23
 */

namespace Disco\App\Analytics\Controllers;

use Disco\App\Analytics\Services\SummaryService;

/**
 * Resolves periods and delegates to SummaryService.
 *
 * No SQL and no query building here — pure orchestration.
 */
class SummaryController extends BaseController {

	/**
	 * Returns the full summary payload for the given request args.
	 *
	 * @param array $args Request args with date_from and date_to as Y-m-d strings (optional).
	 */
	public static function get_summary( array $args ): array {
		$current = self::resolve_current_period( $args );
		$compare = self::resolve_compare_period( $current );

		return array(
			'current_period' => array( 'from' => $current['from'], 'to' => $current['to'] ),
			'compare_period' => array( 'from' => $compare['from'], 'to' => $compare['to'] ),
			'data'           => SummaryService::get_summary( $current, $compare ),
		);
	}

}

```
