Skip to main content

GravityMath_Summary_Request

Value object that represents a summary request.

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:8

Details​

  • Kind: class
  • Namespace: (global)

Methods​

MethodDescription
from_array()Create a Request object from an array.
operation()The request operation.
form_id()Returns the form ID.
view_id()Returns the View ID.
is_sum()Whether this is a request to calculate the sum.
is_average()Whether this is a request to calculate the average.
is_minimum()Whether this is a request to calculate the minimum.
is_maximum()Whether this is a request to calculate the maximum.
is_count()Whether this is a request to calculate the count.
is_view_request()Returns whether the request is a View request.
is_order_by_field()Whether the results should be ordered by the field.
is_ordered_asc()Whether the results should be ordered by ASC.
is_entries_all()Whether to use all entries for the calculations.
limit()The amount to limit the results by.
group_by()The field to group by.
group_by_label()Returns the group by label.
operation_label()Returns the operation label.
use_values()Whether to display the stored choice values instead of the choice labels in the group column.
applied_field()The field the operation is applied on.
decimals()Returns the amount of decimals to show.
filter()Returns the filter query string.
group_by_as_column()Returns the GROUP BY field as a GF Query Column.
applied_field_as_column()Returns the applied field as a GF Query Column.

Method Reference​

from_array()​

public static function from_array( array $request ): self

Create a Request object from an array.

Parameters​

NameTypeDefaultDescription
$requestarrayThe request array.

Returns​

  • self

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:191

operation()​

public function operation(): string

The request operation.

Returns​

  • string

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:217

form_id()​

public function form_id(): int

Returns the form ID.

Returns​

  • int

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:226

view_id()​

public function view_id(): ?int

Returns the View ID.

Returns​

  • int | null — The View ID.

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:237

is_sum()​

public function is_sum(): bool

Whether this is a request to calculate the sum.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:246

is_average()​

public function is_average(): bool

Whether this is a request to calculate the average.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:255

is_minimum()​

public function is_minimum(): bool

Whether this is a request to calculate the minimum.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:264

is_maximum()​

public function is_maximum(): bool

Whether this is a request to calculate the maximum.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:273

is_count()​

public function is_count(): bool

Whether this is a request to calculate the count.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:282

is_view_request()​

public function is_view_request(): bool

Returns whether the request is a View request.

Returns​

  • bool — Whether the request is a View request.

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:293

is_order_by_field()​

public function is_order_by_field(): bool

Whether the results should be ordered by the field.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:302

is_ordered_asc()​

public function is_ordered_asc(): bool

Whether the results should be ordered by ASC.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:311

is_entries_all()​

public function is_entries_all(): bool

Whether to use all entries for the calculations.

Returns​

  • bool

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:320

limit()​

public function limit(): int

The amount to limit the results by.

Returns​

  • int

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:329

group_by()​

public function group_by(): string

The field to group by.

Returns​

  • string

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:346

group_by_label()​

public function group_by_label(): string

Returns the group by label.

Returns​

  • string

Since: 2.5.0 (The group by label.)

Source: includes/summary/class-gravitymath-summary-request.php:357

operation_label()​

public function operation_label(): string

Returns the operation label.

Returns​

  • string — The operation label.

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:368

use_values()​

public function use_values(): bool

Whether to display the stored choice values instead of the choice labels in the group column.

Returns​

  • bool — Whether to display the stored values.

Since: 2.12.0

Source: includes/summary/class-gravitymath-summary-request.php:379

applied_field()​

public function applied_field(): ?string

The field the operation is applied on.

Returns​

  • ?string

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:388

decimals()​

public function decimals(): ?int

Returns the amount of decimals to show.

Returns​

  • int | null — The amount of decimals.

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:403

filter()​

public function filter(): string

Returns the filter query string.

Returns​

  • string — The filter query string.

Since: 2.10.0

Source: includes/summary/class-gravitymath-summary-request.php:414

group_by_as_column()​

public function group_by_as_column(): GF_Query_Column

Returns the GROUP BY field as a GF Query Column.

Returns​

  • GF_Query_Column

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:432

applied_field_as_column()​

public function applied_field_as_column(): GF_Query_Column

Returns the applied field as a GF Query Column.

Returns​

  • GF_Query_Column

Since: 2.5.0

Source: includes/summary/class-gravitymath-summary-request.php:441