Skip to content

Commit a1ceab2

Browse files
ericgesclaude
andcommitted
docs: align v0.2 docs with element-owned filter architecture (PR #20)
Rewrites the developer documentation for the v0.2 filter subsystem rework: - Delete pages for removed subsystems: DCA callbacks (callbacks.mdx), filter invokers (spec/invoker.md), and the six removed filter-element contracts (form-data, form-type-options, hydrate-form, intrinsic-value, runtime-value, palette). - New pages: dev/filter-types (custom filter types guide), dev/dca-builder (backend DCA building via DcaContract/DcaBuilder/ElementDcaEvent), dev/contracts/dca-contract, spec/filtering (filter pipeline architecture), reference/filter-types (built-in type catalog), migrating-from-v0.1, removed-in-v0.2, and an unlisted preflight-v0.2 release checklist. - Rewrite dev/filter-elements around the buildForm/buildFilter/buildDca/ configureOptions lifecycle, dev/events for the new event set and named aliases (.building/.built/.form_built/.dca), spec/specifications around the immutable Filter value object and the keyed addFilter() API, and dev/contracts/index for the new contract layout. - Update attribute docs (#[AsFilterElement] without palette/formType/method, #[AsListType] without palette), engine-mods examples to SimpleEquationFilterElement::define() + addFilter(), Twig docs for the new flare_make_filter() helper, and reference tables for the new Filter\Element namespace and per-element form controls. - flare_enclosure_files is documented as removed (code removal tracked on the preflight page). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5f9cc28 commit a1ceab2

30 files changed

Lines changed: 1126 additions & 790 deletions

docs/dev/callbacks.mdx

Lines changed: 0 additions & 218 deletions
This file was deleted.

docs/dev/contracts/_options-interface.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ public function configureOptions(OptionsResolver $resolver): void
2727

2828
## Important distinction
2929

30-
This contract is not the same as `FormTypeOptionsContract`.
30+
This contract is not the same as `FilterElementOptionsInterface`.
3131

32-
- Use `OptionsInterface` to define and validate custom option structures with `OptionsResolver`.
33-
- Use `FormTypeOptionsContract` to build Symfony form field options for a rendered filter field.
32+
- Use `Filter\Element\FilterElementOptionsInterface` for a filter element's canonical config schema — it is
33+
resolved by FLARE's filter pipeline and pairs `configureOptions()` with `configFromRow()`.
34+
- `Contract\OptionsInterface` is a generic marker for any service that wants to expose an
35+
`OptionsResolver`-based option schema.
3436

3537
## Current state in this repository
3638

37-
`AbstractFilterElement` implements this interface with a no-op method, and `SimpleEquationElement` overrides it.
38-
39-
At the moment, there is no internal runtime call site in `src/` that invokes `OptionsInterface::configureOptions()`
40-
directly. Treat it as part of Flare's extensibility surface for code that wants to resolve custom options explicitly.
39+
At the moment, there is no implementor and no internal runtime call site in `src/` that invokes
40+
`OptionsInterface::configureOptions()` directly. Treat it as part of Flare's extensibility surface for code
41+
that wants to resolve custom options explicitly.

docs/dev/contracts/dca-contract.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# DcaContract
2+
3+
The `DcaContract` lets a filter element or list type assemble its backend DCA configuration — palette and
4+
field tweaks — at runtime.
5+
6+
**Interface:** `HeimrichHannot\FlareBundle\Contract\DcaContract`
7+
8+
## Method
9+
10+
### `buildDca(DcaBuilder $dca, DcaContext $context): void`
11+
12+
Declare the type's palette and per-field adjustments on the `DcaBuilder`. The `DcaContext` provides the
13+
record being edited (`listModel`, `filterModel`) and lazy access to the list's execution context (table
14+
aliases, target table).
15+
16+
FLARE's `loadDataContainer` listener applies the collected configuration to `$GLOBALS['TL_DCA']` for
17+
`tl_flare_filter` and `tl_flare_list`. After `buildDca()` runs, an
18+
[`ElementDcaEvent`](../dca-builder.md#5-modifying-another-types-dca) is dispatched so third parties can
19+
adjust the result.
20+
21+
`AbstractFilterElement` implements this contract with a no-op default; list types opt in by implementing the
22+
interface.
23+
24+
## Example
25+
26+
```php
27+
use HeimrichHannot\FlareBundle\DataContainer\Builder\DcaBuilder;
28+
use HeimrichHannot\FlareBundle\DataContainer\Builder\DcaContext;
29+
30+
public function buildDca(DcaBuilder $dca, DcaContext $context): void
31+
{
32+
$dca->palette('{filter_legend},fieldGeneric,label');
33+
34+
$dca->field('fieldGeneric')
35+
->options(fn (): array => $this->getFieldOptions($context->getTargetTable()));
36+
}
37+
```
38+
39+
See the [Backend DCA Building guide](../dca-builder.md) for the full `DcaBuilder`, `DcaFieldBuilder`, and
40+
`DcaContext` API.

docs/dev/contracts/form-data-contract.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/dev/contracts/form-type-options-contract.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)