ICanBoogie
  • Documentation
  • API Reference
  • bind-facets v0.5.0
Namespaces
  • ICanBoogie
    • Binding
      • Facets
Classes
  • Hooks
Interfaces
  • HasCriteriaProperty
  • HasCriterionListProperty
  • HasFetchRecordMethod
  • HasFetchRecordsMethod
Traits
  • ModelBindings

Class Hooks

Namespace: ICanBoogie\Binding\Facets
Located at Hooks.php

Methods summary

public static synthesize_config( array $fragments ) : array

Synthesizes the activerecord_facets config from activerecord fragments.

Synthesizes the activerecord_facets config from activerecord fragments.

Parameters

$fragments

Returns

array
public static criteria_from( ICanBoogie\ActiveRecord\Model $model ) : array

Returns the criteria associated with the specified model.

Returns the criteria associated with the specified model.

The criteria include the criteria of the parent models.

Parameters

$model

Returns

array
public static criterion_list_from( ICanBoogie\ActiveRecord\Model $model ) : ICanBoogie\Facets\CriterionList

Returns the ICanBoogie\Facets\CriterionList instance associated with the specified model.

Returns the ICanBoogie\Facets\CriterionList instance associated with the specified model.

Parameters

$model

Returns

ICanBoogie\Facets\CriterionList
public static fetch_records( ICanBoogie\ActiveRecord\Model $model, array $conditions ) : ICanBoogie\Facets\RecordCollection|null

Fetches the records matching the specified conditions.

Fetches the records matching the specified conditions.

A ICanBoogie\Facets\Fetcher\BasicFetcher instance is used to fetch the records.

Parameters

$model
$conditions

Returns

ICanBoogie\Facets\RecordCollection|null
public static fetch_record( ICanBoogie\ActiveRecord\Model $model, array $conditions, ICanBoogie\Facets\Fetcher & $fetcher = null ) : ICanBoogie\ActiveRecord|null

Fetches a record matching the specified conditions.

Fetches a record matching the specified conditions.

The model's ICanBoogie\Binding\Facets\Hooks::fetch_records() prototype method is used to retrieve the record.

Parameters

$model
$conditions
$fetcher

If the parameter fetcher is present, the ICanBoogie\Facets\Fetcher instance used to fetch the record is stored inside.

Returns

ICanBoogie\ActiveRecord|null
bind-facets v0.5.0 – Check on GitHub – API documentation generated by ApiGen