PHPackages                             icanboogie/bind-facets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. icanboogie/bind-facets

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

icanboogie/bind-facets
======================

Binds icanboogie/facets to ICanBoogie

v5.0.0(5y ago)08384BSD-3-ClausePHPPHP &gt;=7.2CI failing

Since May 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/bind-facets)[ Packagist](https://packagist.org/packages/icanboogie/bind-facets)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-bind-facets/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (8)Used By (4)

bind-facets
===========

[](#bind-facets)

[![Release](https://camo.githubusercontent.com/0db9fab6b069f01aa3c0c819d161ddec9e80efddc6aeb5110a5fe4c4ad40cbf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f62696e642d6661636574732e737667)](https://packagist.org/packages/icanboogie/bind-facets)[![Build Status](https://camo.githubusercontent.com/db66eca041780e033021dcda7ccaf07562371524ef82e51b0ec32bdfc5fdd4a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4943616e426f6f6769652f62696e642d6661636574732f74657374)](https://github.com/ICanBoogie/bind-facets/actions?query=workflow%3Atest)[![Code Quality](https://camo.githubusercontent.com/2886d6328407c72a6bc23a2f7371c7411eab4571e13e71930ff3faff376448d9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4943616e426f6f6769652f62696e642d6661636574732e737667)](https://scrutinizer-ci.com/g/ICanBoogie/bind-facets)[![Code Coverage](https://camo.githubusercontent.com/595d174813e3947e3198d60f814638e27375bd8ecd076aa1cd9fe09ed60e2ef5/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4943616e426f6f6769652f62696e642d6661636574732e737667)](https://coveralls.io/r/ICanBoogie/bind-facets)[![Packagist](https://camo.githubusercontent.com/53c3af853759d267d06f962c5a90d347ece814b41e9efc7daef9eb8fa3582944/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f62696e642d6661636574732e737667)](https://packagist.org/packages/icanboogie/bind-facets)

The **icanboogie/bind-facets** package binds [icanboogie/facets](https://github.com/ICanBoogie/Render) to [ICanBoogie](https://github.com/ICanBoogie/ICanBoogie), using its autoconfig feature, and provides the following features:

- A synthesizer for the `activerecord_facets` config.
- A `criteria` prototype property for [Model](https://icanboogie.org/api/activerecord/master/class-ICanBoogie.ActiveRecord.Model.html) instances.
- A `criterion_list` prototype property for [Model](https://icanboogie.org/api/activerecord/master/class-ICanBoogie.ActiveRecord.Model.html) instances.
- A `fetch_record()` prototype method for [Model](https://icanboogie.org/api/activerecord/master/class-ICanBoogie.ActiveRecord.Model.html) instances.
- A `fetch_records()` prototype method for [Model](https://icanboogie.org/api/activerecord/master/class-ICanBoogie.ActiveRecord.Model.html) instances.

Hinting prototype bindings
--------------------------

[](#hinting-prototype-bindings)

Because most features are provided through prototype methods, your favorite editor might complain about unknown methods, in which case simply use the [ModelBindings](https://icanboogie.org/api/bind-facets/master/class-ICanBoogie.Binding.Facets.ModelBindings.html) trait.

The following example demonstrates how to hint your code about a `fetch_records` method. Notice the type hint in the annotation `Model|ModelBindings`:

```
