| 1 | <?php |
||
| 17 | class ConstraintBuilder |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var ConstraintBuilderInterface[] |
||
| 21 | */ |
||
| 22 | private $builders = []; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Add constraint builder |
||
| 26 | * |
||
| 27 | * @param ConstraintBuilderInterface $builder Constraint builder |
||
| 28 | * |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | 8 | public function addConstraintBuilder(ConstraintBuilderInterface $builder) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Go through the constraints and call the builders to do their job |
||
| 38 | * |
||
| 39 | * @param string $fieldName field name |
||
| 40 | * @param Schema $property the property |
||
| 41 | * @param DocumentModel $model the parent model |
||
| 42 | * |
||
| 43 | * @return Schema |
||
| 44 | */ |
||
| 45 | 4 | public function addConstraints($fieldName, Schema $property, DocumentModel $model) |
|
| 63 | } |
||
| 64 |