| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 45 | public function addConstraints($fieldName, Schema $property, DocumentModel $model) |
||
| 46 | { |
||
| 47 | $constraints = $model->getConstraints($fieldName); |
||
| 48 | |||
| 49 | if (!is_array($constraints)) { |
||
| 50 | return $property; |
||
| 51 | } |
||
| 52 | |||
| 53 | foreach ($constraints as $constraint) { |
||
| 54 | foreach ($this->builders as $builder) { |
||
| 55 | if ($builder->supportsConstraint($constraint->name, $constraint->options)) { |
||
| 56 | $property = $builder->buildConstraint($fieldName, $property, $model, $constraint->options); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | return $property; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |