markup / contentful-sdk-bridge
A small bridge library to convert resources from the official Contentful SDK into resources compatible with the markup/contentful library.
Installs: 1 576
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.1
- contentful/contentful: ^4
- markup/contentful: >=0.13, <1
Requires (Dev)
- mockery/mockery: ^1.2
- phpstan/phpstan-shim: 0.11.5
- phpunit/phpunit: ^7.5
- symfony/phpunit-bridge: ^4.2
This package is auto-updated.
Last update: 2024-10-25 23:01:12 UTC
README
A small bridge library to convert resources from the official Contentful SDK into resources compatible with the markup/contentful library.
Installation
The Markup contentful-sdk-bridge bundle can be installed via Composer by
requiring themarkup/contentful-sdk-bridge
package in your project's composer.json
:
{ "require": { "markup/contentful-sdk-bridge": "0.1" } }
Usage
The package provides some simple adapters enabling resources emitted from the official Contentful SDK to be used as if they are resources emitted from Markup's Contentful library.
Examples:
use Markup\ContentfulSdkBridge\AdaptedAsset; use Markup\ContentfulSdkBridge\AdaptedContentType; use Markup\ContentfulSdkBridge\AdaptedEntry; $space = 'content_space'; $locale = 'en-US'; /** @var \Contentful\Delivery\Resource\Entry $sdkEntry */ $markupEntry = new AdaptedEntry( $sdkEntry, $locale, $space ); /** @var \Contentful\Delivery\Resource\Asset $sdkAsset */ $markupAsset = new AdaptedAsset( $sdkAsset, $locale ); /** @var \Contentful\Delivery\Resource\ContentType $sdkContentType */ $markupContentType = new AdaptedContentType($sdkContentType);