Skip to main content

GravityKit\GravityView\Pro\LiveFilters\Search\Faceting\FacetFreeRequest

A request with the facet selections stripped out.

Facet counts are taken against everything the View narrows by except the facets themselves, which the facet engine applies per count and must be able to leave out one at a time. Handing the search bar this request means it filters by what the visitor typed and nothing else, without knowing that Live Filters exists.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:17

Details​

  • Kind: class
  • Namespace: GravityKit\GravityView\Pro\LiveFilters\Search\Faceting
  • Extends: Request

Methods​

MethodDescription
wrapping()Returns the given request with its facet selections removed.
get_arguments()Returns the arguments this request carries.
is_renderable()Whether this request is something that is renderable.
is_view()The current $post is a View, no?
is_entry()Checks whether this is a single entry request
is_edit_entry()Checks whether this an edit entry request.
is_search()Checks whether this an entry search request.

Method Reference​

wrapping()​

public static function wrapping( Request $request ): self

Returns the given request with its facet selections removed.

Parameters​

NameTypeDefaultDescription
$requestRequestThe request being answered.

Returns​

  • self — The facet-free request.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:49

get_arguments()​

public function get_arguments(): array

Returns the arguments this request carries.

Defaults to the ambient HTTP request, read from the superglobal the configured search method names rather than the HTTP verb. Transports that transmit their own arguments (CLI, a mocked render) override this, and their answer is authoritative even when empty.

Returns​

  • array<string, — mixed> The arguments.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:58

is_renderable()​

public function is_renderable()

Whether this request is something that is renderable.

Returns​

  • bool — Yes or no.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:75

is_view()​

public function is_view( $return_view=true )

The current $post is a View, no?

Parameters​

NameTypeDefaultDescription
$return_viewbooltrueWhether to return a View object or boolean.

Returns​

  • \GV\View | bool — If the global $post is a View, returns the View or true, depending on $return_view. If not a View, returns false.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:84

is_entry()​

public function is_entry( $form_id=0 )

Checks whether this is a single entry request

Parameters​

NameTypeDefaultDescription
$form_idint0The form ID, since slugs can be non-unique. Default: 0.

Returns​

  • \GV\GF_Entry | false — The entry requested or false.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:93

is_edit_entry()​

public function is_edit_entry( $form_id=0 )

Checks whether this an edit entry request.

Parameters​

NameTypeDefaultDescription
$form_idint0The form ID, since slugs can be non-unique. Default: 0.

Returns​

  • \GV\Entry | false — The entry requested or false.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:102

public function is_search( $view=null )

Checks whether this an entry search request.

Parameters​

NameTypeDefaultDescription
$view\GravityKit\GravityView\View\View | int | nullnullThe View (or its ID) to scope the answer to, if known.

Returns​

  • boolean — True if this is a search request.

Since: $ver$

Source: src/Pro/LiveFilters/Search/Faceting/FacetFreeRequest.php:111