public function getSpacesAndContentTypesAsChoices(): array
    {
        $spaces = [];

        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            $contentTypes = [];
            foreach ($client->getContentTypes()->getItems() as $contentType) {
                /* @var \Contentful\Delivery\Resource\ContentType $contentType */
                $contentTypes[$contentType->getName()] = $contentType->getId();
            }
            $spaces[$client->getSpace()->getName()] = $contentTypes;
        }

        return $spaces;
    }
public function getSpacesAndContentTypesAsChoices(): array
    {
        $spaces = [];

        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            $contentTypes = [];
            foreach ($client->getContentTypes()->getItems() as $contentType) {
                /* @var \Contentful\Delivery\Resource\ContentType $contentType */
                $contentTypes[$contentType->getName()] = $contentType->getId();
            }
            $spaces[$client->getSpace()->getName()] = $contentTypes;
        }

        return $spaces;
    }
public function getSpacesAndContentTypesAsChoices ( ) : array { $ spaces = [ ] ; foreach ( $ this -> clientsConfig as $ clientConfig ) { /** @var \Contentful\Delivery\Client $client */ $ client = $ clientConfig [ 'service' ] ; $ contentTypes = [ ] ; foreach ( $ client -> getContentTypes ( ) -> getItems ( ) as $ contentType ) { /* @var \Contentful\Delivery\Resource\ContentType $contentType */ $ contentTypes [ $ contentType -> getName ( ) ] = $ contentType -> getId ( ) ; } $ spaces [ $ client -> getSpace ( ) -> getName ( ) ] = $ contentTypes ; } return $ spaces ; }
Returns the list of spaces and content types for usage in Symfony Forms.
Returns the list of spaces and content types for usage in Symfony Forms .