b2pweb /
bdf-form
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Bdf\Form\Child; |
||
| 4 | |||
| 5 | use Bdf\Form\Child\Http\HttpFieldsInterface; |
||
| 6 | use Bdf\Form\ElementInterface; |
||
| 7 | use Bdf\Form\Filter\FilterInterface; |
||
| 8 | use Bdf\Form\PropertyAccess\ExtractorInterface; |
||
| 9 | use Bdf\Form\PropertyAccess\HydratorInterface; |
||
| 10 | use Bdf\Form\Transformer\TransformerInterface; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Parameters for create a child |
||
| 14 | */ |
||
| 15 | final class ChildParameters |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The child name |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $name; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The inner element instance |
||
| 26 | * |
||
| 27 | * @var ElementInterface |
||
| 28 | */ |
||
| 29 | public $element; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Http Fields to use |
||
| 33 | * |
||
| 34 | * @var HttpFieldsInterface |
||
| 35 | */ |
||
| 36 | public $fields; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var FilterInterface[] |
||
| 40 | */ |
||
| 41 | public $filters; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var mixed |
||
| 45 | */ |
||
| 46 | public $defaultValue; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var HydratorInterface|null |
||
| 50 | */ |
||
| 51 | public $hydrator; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var ExtractorInterface|null |
||
| 55 | */ |
||
| 56 | public $extractor; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Array of dependencies child names |
||
| 60 | * |
||
| 61 | * @var string[] |
||
| 62 | */ |
||
| 63 | public $dependencies; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @var TransformerInterface|null |
||
| 67 | */ |
||
| 68 | public $modelTransformer; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * The child class name |
||
| 72 | * |
||
| 73 | * @var class-string<ChildInterface> |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 74 | */ |
||
| 75 | public $className; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * The child instance |
||
| 79 | * Set a value to ignore the default child instantiation on the ChildBuilder |
||
| 80 | * |
||
| 81 | * @var ChildInterface|null |
||
| 82 | */ |
||
| 83 | public $child; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * List of child factories to apply |
||
| 87 | * The return value of each factories will fill the $this->child field |
||
| 88 | * |
||
| 89 | * This parameter can be used to decorate a child instance like : |
||
| 90 | * <code> |
||
| 91 | * public function decorateChild(ChildParameters $parameters) |
||
| 92 | * { |
||
| 93 | * $parameters->factories[] = function (ChildParameters $parameters) { |
||
| 94 | * return new MyChildWrapper($parameters->child); |
||
| 95 | * }; |
||
| 96 | * } |
||
| 97 | * </code> |
||
| 98 | * |
||
| 99 | * @var (callable(ChildParameters):ChildInterface)[] |
||
|
0 ignored issues
–
show
|
|||
| 100 | */ |
||
| 101 | public $factories = []; |
||
| 102 | } |
||
| 103 |