ICanBoogie
  • Documentation
  • API Reference
  • Facets master
Namespaces
  • ICanBoogie
    • Facets
      • Criterion
      • CriterionValue
      • Fetcher
      • RecordCollection
Classes
  • BasicFetcher

Class BasicFetcher

Fetch records from a model.

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

Methods summary

protected get_model( void ) : ICanBoogie\ActiveRecord\Model

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

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

Returns

ICanBoogie\ActiveRecord\Model
protected get_modifiers( void ) : array

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

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

Returns

array
protected get_initial_query( void ) : ICanBoogie\ActiveRecord\Query

Return the $initial_query property.

Return the $initial_query property.

Returns

ICanBoogie\ActiveRecord\Query
protected get_query( void ) : ICanBoogie\ActiveRecord\Query

Return the query used to fetch the records.

Return the query used to fetch the records.

Returns

ICanBoogie\ActiveRecord\Query
protected get_query_string( void ) : ICanBoogie\Facets\QueryString

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

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

Returns

ICanBoogie\Facets\QueryString
protected get_conditions( void ) : array

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

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

Returns

array
protected get_order( void ) : string|null

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

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

Returns

string|null
protected get_limit( void ) : integer|null

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

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

Returns

integer|null
protected get_offset( void )
protected get_page( void )
protected get_count( void ) : integer

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

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

Returns

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

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

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

Parameters

$model
$options
public __clone( void )

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

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

public __invoke( array $modifiers ) : array

Fetch records according to the specified modifiers.

Fetch records according to the specified modifiers.

The method updates the following properties:

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

Parameters

$modifiers

Returns

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

Create the initial query.

Create the initial query.

Returns

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

Parse modifiers to extract conditions, and qualifiers.

Parse modifiers to extract conditions, and qualifiers.

Parameters

$modifiers

Returns

array

Methods inherited from ICanBoogie\Facets\Fetcher

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 $model : ICanBoogie\ActiveRecord\Model

The model from witch records are fetched.

The model from witch records are fetched.


		
protected $modifiers : array

Fetch modifiers.

Fetch modifiers.


		
protected $options : array

Options.

Options.

[]
protected $query_string : ICanBoogie\Facets\QueryString

Query string resolved from the modifiers.

Query string resolved from the modifiers.


		
protected $conditions : array

Conditions resolved from the modifiers.

Conditions resolved from the modifiers.

[]
protected $order : string|null

Order of the records, as found in the modifiers.

Order of the records, as found in the modifiers.


		
protected $limit : string|null

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 $count : integer

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 $model : ICanBoogie\ActiveRecord\Model

The model from which record are fetched.

public read-only $criterion_list : ICanBoogie\Facets\CriterionList

List of criterion.

public read-only $modifiers : array

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

public read-only $initial_query : ICanBoogie\ActiveRecord\Query

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

public read-only $query : ICanBoogie\ActiveRecord\Query

The query used to fetch the records.

public read-only $query_string : ICanBoogie\Facets\QueryString

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

public read-only $conditions : array

An array of conditions used to filter the fetched records.

public read-only $order : string

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

public read-only $count : integer

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

public read-only $limit : integer

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

Facets master – Check on GitHub – API documentation generated by ApiGen