Exemplo n.º 1
0
 protected function shouldExcludeLink(RelationMetadataInterface $relationMetadata, $object)
 {
     if (!($fields = $relationMetadata->getExcludeIf())) {
         return false;
     }
     foreach ($fields as $field => $valueToExclude) {
         $field = trim($field, '.');
         $propertyPath = new PropertyPath($field);
         $value = $this->propertyAccessor->getValue($object, $propertyPath);
         if ($valueToExclude === $value) {
             return true;
         }
     }
     return false;
 }