public function getContentType(string $id): ?ContentType
    {
        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            foreach ($client->getContentTypes()->getItems() as $contentType) {
                /** @var \Contentful\Delivery\Resource\ContentType $contentType */
                if ($contentType->getId() === $id) {
                    return $contentType;
                }
            }
        }

        return null;
    }
public function getContentType(string $id): ?ContentType
    {
        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            foreach ($client->getContentTypes()->getItems() as $contentType) {
                /** @var \Contentful\Delivery\Resource\ContentType $contentType */
                if ($contentType->getId() === $id) {
                    return $contentType;
                }
            }
        }

        return null;
    }
public function getContentType ( string $ id ) : ? ContentType { foreach ( $ this -> clientsConfig as $ clientConfig ) { /** @var \Contentful\Delivery\Client $client */ $ client = $ clientConfig [ 'service' ] ; foreach ( $ client -> getContentTypes ( ) -> getItems ( ) as $ contentType ) { /** @var \Contentful\Delivery\Resource\ContentType $contentType */ if ( $ contentType -> getId ( ) === $ id ) { return $ contentType ; } } } return null ; }
Returns the content type with specified ID.

If no content type is found, null is returned.
Returns the content type with specified ID .