<?php
/**
 * @author Jaap Jansma <jaap.jansma@civicoop.org>
 * @license AGPL-3.0
 */

namespace Civi\DataProcessor\FieldOutputHandler;

interface OutputHandlerAggregate {

  /**
   * @return \Civi\DataProcessor\DataSpecification\FieldSpecification
   */
  public function getAggregateFieldSpec();

  /**
   * @return bool
   */
  public function isAggregateField();

  /**
   * Enable aggregation for this field.
   *
   * @return void
   */
  public function enableAggregation();

  /**
   * Disable aggregation for this field.
   *
   * @return void
   */
  public function disableAggregation();


  /**
   * Returns the value. And if needed a formatting could be applied.
   * E.g. when the value is a date field and you want to aggregate on the month
   * you can then return the month here.
   *
   * @param $value
   *
   * @return mixed
   */
  public function formatAggregationValue($value);

}
