ICanBoogie/Facets v0.3.1
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Facets
      • RecordCollection

Classes

  • BooleanCriterion
  • Criterion
  • CriterionList
  • CriterionNotDefined
  • CriterionValue
  • Fetcher
  • IntervalCriterionValue
  • QueryString
  • QueryStringWord
  • RecordCollection
  • SetCriterionValue

Interfaces

  • CriterionInterface
  • FetcherInterface

Traits

  • CriterionTrait
  • FetcherTrait
  • HumanizePairsTrait
  • ParseQueryStringTrait

Class Fetcher

Fetch records from a model.

ICanBoogie\Facets\Fetcher implements ICanBoogie\Facets\FetcherInterface uses ICanBoogie\Accessor\AccessorTrait (not available) ICanBoogie\Facets\FetcherTrait
Namespace: ICanBoogie\Facets
Located at Fetcher.php

Methods summary

protected ICanBoogie\ActiveRecord\Model
# get_model( )

Return the ICanBoogie\Facets\Fetcher::$model property.

Return the ICanBoogie\Facets\Fetcher::$model property.

Returns

ICanBoogie\ActiveRecord\Model
protected array
# get_modifiers( )

Return the ICanBoogie\Facets\Fetcher::$modifiers property.

Return the ICanBoogie\Facets\Fetcher::$modifiers property.

Returns

array
protected ICanBoogie\ActiveRecord\Query
# get_initial_query( )

Return the $initial_query property.

Return the $initial_query property.

Returns

ICanBoogie\ActiveRecord\Query
protected ICanBoogie\ActiveRecord\Query
# get_query( )

Return the query used to fetch the records.

Return the query used to fetch the records.

Returns

ICanBoogie\ActiveRecord\Query
protected ICanBoogie\Facets\QueryString
# get_query_string( )

Return the ICanBoogie\Facets\Fetcher::$query_string property.

Return the ICanBoogie\Facets\Fetcher::$query_string property.

Returns

ICanBoogie\Facets\QueryString
protected array
# get_conditions( )

Return the ICanBoogie\Facets\Fetcher::$conditions property.

Return the ICanBoogie\Facets\Fetcher::$conditions property.

Returns

array
protected string|null
# get_order( )

Return the ICanBoogie\Facets\Fetcher::$order property.

Return the ICanBoogie\Facets\Fetcher::$order property.

Returns

string|null
protected integer|null
# get_limit( )

Return the ICanBoogie\Facets\Fetcher::$limit property.

Return the ICanBoogie\Facets\Fetcher::$limit property.

Returns

integer|null
protected
# get_offset( )
protected
# get_page( )
protected integer
# get_count( )

Return the ICanBoogie\Facets\Fetcher::$count property.

Return the ICanBoogie\Facets\Fetcher::$count property.

Returns

integer
public
# __construct( ICanBoogie\ActiveRecord\Model $model, array $options = [] )

Initializes the ICanBoogie\Facets\Fetcher::$model, ICanBoogie\Facets\Fetcher::$options and ICanBoogie\Facets\Fetcher::$criterion_list properties.

Initializes the ICanBoogie\Facets\Fetcher::$model, ICanBoogie\Facets\Fetcher::$options and ICanBoogie\Facets\Fetcher::$criterion_list properties.

Parameters

$model
$options
public
# __clone( )

Clones the initial_query, query, and ICanBoogie\Facets\Fetcher::$query_string properties.

Clones the initial_query, query, and ICanBoogie\Facets\Fetcher::$query_string properties.

public array
# __invoke( array $modifiers )

Fetch records according to the specified modifiers.

Fetch records according to the specified modifiers.

The method updates the following properties:

  • ICanBoogie\Facets\Fetcher::$conditions
  • ICanBoogie\Facets\Fetcher::$count
  • $initial_query
  • ICanBoogie\Facets\Fetcher::$limit
  • ICanBoogie\Facets\Fetcher::$modifiers
  • ICanBoogie\Facets\Fetcher::$offset
  • ICanBoogie\Facets\Fetcher::$order
  • ICanBoogie\Facets\Fetcher::$query_string

Parameters

$modifiers

Returns

array
The records matching the query.
protected ICanBoogie\ActiveRecord\Query
# create_initial_query( )

Create the initial query.

Create the initial query.

Returns

ICanBoogie\ActiveRecord\Query
protected array
# parse_modifiers( array $modifiers )

Parse modifiers to extract conditions, and qualifiers.

Parse modifiers to extract conditions, and qualifiers.

Parameters

$modifiers

Returns

array

Methods inherited from ICanBoogie\Facets\FetcherInterface

alter_conditions(), alter_criterion_list(), alter_query(), alter_query_with_conditions(), alter_query_with_limit(), alter_query_with_order(), alter_records(), count_records(), fetch_records(), parse_query_string()

Methods used from ICanBoogie\Facets\FetcherTrait

alter_conditions(), alter_criterion_list(), alter_query(), alter_query_with_conditions(), alter_query_with_limit(), alter_query_with_order(), alter_records(), count_records(), fetch_records(), get_criterion_list(), parse_query_string()

Properties summary

protected ICanBoogie\ActiveRecord\Model $model

The model from witch records are fetched.

The model from witch records are fetched.

#
protected array $modifiers

Fetch modifiers.

Fetch modifiers.

#
protected array $options

Options.

Options.

# []
protected ICanBoogie\Facets\QueryString $query_string

Query string resolved from the modifiers.

Query string resolved from the modifiers.

#
protected array $conditions

Conditions resolved from the modifiers.

Conditions resolved from the modifiers.

# []
protected string|null $order

Order of the records, as found in the modifiers.

Order of the records, as found in the modifiers.

#
protected string|null $limit

Limit of the number of records to fetch, as found in the modifiers.

Limit of the number of records to fetch, as found in the modifiers.

#
protected $offset
#
protected integer $count

Number of records matching the query, before they are limited.

Number of records matching the query, before they are limited.

#

Properties used from ICanBoogie\Facets\FetcherTrait

$criterion_list

Magic properties

public read-only ICanBoogie\ActiveRecord\Model $model

The model from which record are fetched.

public read-only ICanBoogie\Facets\CriterionList $criterion_list

List of criterion.

public read-only array $modifiers

An array of key/value used to filter/order/qualify the records.

public read-only ICanBoogie\ActiveRecord\Query $initial_query

The initial query, before it is altered by the criteria, conditions, order or limit.

public read-only ICanBoogie\ActiveRecord\Query $query

The query used to fetch the records.

public read-only ICanBoogie\Facets\QueryString $query_string

A ICanBoogie\Facets\QueryString instance resolved from the q modifier.

public read-only array $conditions

An array of conditions used to filter the fetched records.

public read-only string $order

The order in which records are fetched, as defined by the order modifier.

public read-only integer $count

The number of records matching the query before the offset and limit is applied.

public read-only integer $limit

The maximum number of records that can be fetched, as defined by the limit modifier.

ICanBoogie/Facets v0.3.1 API documentation generated by ApiGen