You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This subject won't be directly treated here. You can either follow the official
documentation or use a
bundle/module/whatever the framework you're using promotes.
Configure RulerZ
Once Doctrine DBAL is installed and configured we can the RulerZ engine:
$rulerz = newRulerZ(
$compiler, [
new \RulerZ\DoctrineDBAL\Target\DoctrineDBAL(), // this line is Doctrine DBAL-specific// other compilation targets...
]
);
The only Doctrine DBAL-related configuration is the DoctrineDBAL target being added to the list
of the known compilation targets.
Filter your target
Now that both the DBAL and RulerZ are ready, you can use them to retrieve data.
The DoctrineDBAL instance that we previously injected into the RulerZ engine
only knows how to use Doctrine\DBAL\Query\QueryBuilder so the first step
is to create one and configure it:
And as usual, we call RulerZ with our target (the QueryBuilder object) and our rule.
RulerZ will build the right executor for the given target and use it to filter
the data, or in our case to retrieve data from a database.