| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function guessType($class, $property) |
||
| 22 | { |
||
| 23 | if (!$ret = $this->getMetadata($class)) { |
||
| 24 | return null; |
||
| 25 | } |
||
| 26 | |||
| 27 | list($metadata, $name) = $ret; |
||
| 28 | if ($metadata->hasAssociation($property)) { |
||
| 29 | $multiple = $metadata->isCollectionValuedAssociation($property); |
||
| 30 | $mapping = $metadata->getAssociationMapping($property); |
||
| 31 | |||
| 32 | $class = $mapping['targetEntity']; |
||
| 33 | $interfaces = class_implements($class); |
||
| 34 | if (in_array(SaasClientRelatedInterface::class, $interfaces)) { |
||
| 35 | return new TypeGuess(ClientEntityType::class, [ |
||
| 36 | 'em' => $name, |
||
| 37 | 'class' => $class, |
||
| 38 | 'multiple' => $multiple, |
||
| 39 | ], Guess::HIGH_CONFIDENCE); |
||
| 40 | } |
||
| 44 |