Can we simplify both to:
```php
if ($this->hasRelation($value['type'])) {
}
// ...
private function hasRelation($type)
{
    return in_array($type, array(ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::ONE_TO_ONE), true);
}