Skip to content

Instantly share code, notes, and snippets.

@mendelB
Created September 5, 2018 15:46
Show Gist options
  • Save mendelB/c4d3ac9d39117279a5c1fd89bdc7cd49 to your computer and use it in GitHub Desktop.
Save mendelB/c4d3ac9d39117279a5c1fd89bdc7cd49 to your computer and use it in GitHub Desktop.
Cool changes of note in the Contentful SDK
1.2.0
* Implemented ResourceArray::getItems to allow access to the values of a ResourceArray as an actual PHP array.
2.0.0
* Moved file classes to a sub-namespace Contentful\File [BREAKING].
* Contentful\File to Contentful\File\File
* Contentful\ImageFile to Contentful\File\ImageFile
* Contentful\ImageOptions to Contentful\File\ImageOptions
2.1.0
* Contentful\Client now includes a getLogger method, for easy access to the logger currently in use.
2.4.0
* The Contentful\Delivery\Query class now has linksToEntry('<entry_id>') and linksToAsset('<entry_id>')methods. For users on older versions of the SDK, the same operators can be emulated by using $query->where('links_to_entry', '<entry_id>') and $query->where('links_to_asset', '<asset_id>'). DynamicEntryalso provides a shortcut in the form $entry->getReferences().
3.0.0
* Caching - https://github.com/contentful/contentful.php/blob/master/UPGRADE-3.0.md#updated-cache-mechanism
* Logging - https://github.com/contentful/contentful.php/blob/master/UPGRADE-3.0.md#updated-logging-mechanism
3.1.0
* The magic __call method now allow for access also using the actual field name, without get prefix (for instance $entry->title()). This was done to further improve compatibility on edge cases with templating engines such as Twig.
* Entries now have a has($field) method (with a magic hasX() equivalent) which returns whether an entry has the given field currently loaded.
3.3.0
* Added getSpaceId and getEnvironmentId to the Client.
3.4.0
* The SDK can now use a locally-cached copy of entries and asset. While this will not prevent API calls when using getEntries or getAssets, it will intercept calls made with getEntry and getAsset, including those being made when resolving a link from an entry. You can enable this either using the CLI commands with the --cache-contentflag, or passing 'cacheContent' => true to the $options array in the client constructor (requires 'autoWarmup' to also be set to true).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment