src/Graviton/SchemaBundle/SchemaUtils.php
private function getCollectionItemType($className, $fieldName)
    {
        $serializerMetadata = $this->serializerMetadataFactory->getMetadataForClass($className);
        if ($serializerMetadata === null) {
            return null;
        }
        if (!isset($serializerMetadata->propertyMetadata[$fieldName])) {
            return null;
        }

        $type = $serializerMetadata->propertyMetadata[$fieldName]->type;
        return isset($type['name'], $type['params'][0]['name']) && $type['name'] === 'array' ?
            $type['params'][0]['name'] :
            null;
    }
private function getCollectionItemType($className, $fieldName)
    {
        $serializerMetadata = $this->serializerMetadataFactory->getMetadataForClass($className);
        if ($serializerMetadata === null) {
            return null;
        }
        if (!isset($serializerMetadata->propertyMetadata[$fieldName])) {
            return null;
        }

        $type = $serializerMetadata->propertyMetadata[$fieldName]->type;
        return isset($type['name'], $type['params'][0]['name']) && $type['name'] === 'array' ?
            $type['params'][0]['name'] :
            null;
    }
private function getCollectionItemType ( $ className , $ fieldName ) { $ serializerMetadata = $ this -> serializerMetadataFactory -> getMetadataForClass ( $ className ) ; if ( $ serializerMetadata === null ) { return null ; } if ( ! isset ( $ serializerMetadata -> propertyMetadata [ $ fieldName ] ) ) { return null ; } $ type = $ serializerMetadata -> propertyMetadata [ $ fieldName ] -> type ; return isset ( $ type [ 'name' ] , $ type [ 'params' ] [ 0 ] [ 'name' ] ) && $ type [ 'name' ] === 'array' ? $ type [ 'params' ] [ 0 ] [ 'name' ] : null ; }
Get item type of collection field

@param string $className Class name
@param string $fieldName Field name
@return string|null
Get item type of collection field