Download the PHP package michaeljamesparsons/metropublisher-php-sdk without Composer
On this page you can find all versions of the php package michaeljamesparsons/metropublisher-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michaeljamesparsons/metropublisher-php-sdk
More information about michaeljamesparsons/metropublisher-php-sdk
Files in michaeljamesparsons/metropublisher-php-sdk
Package metropublisher-php-sdk
Short Description A simple wrapper for the MetroPublisher API.
License MIT
Informations about the package metropublisher-php-sdk
MetroPublisher SDK Beta
This is a fully featured SDK for the MetroPublisherTM REST API. It takes care of the boilerplate HTTP client request/response logic for you so you can dive right into implementing the API into your app.
Installation
The recommended method of installation is through composer.
composer require michaeljamesparsons/metropublisher-php-sdk
Dependencies
If you are using composer, these dependencies should be installed automatically.
Quickstart
Dictionary
Models
A model
represents an object in the MetroPublisher API. For example, this could be an article, event, location, or other object. The properties of these objects map to the fields defined for that object in the official API resource reference.
Resource Models
A resource model
is a type of model which, unlike non-resource models, can be saved to the API or deleted from it. Some resource models have extra methods that allow them to fetch other models that are related to them. Not all of the resource models have been implemented, but I've listed the ones that are ready for you below!
- Article
- Event
- AlbumReview
- BookReview
- LocationReview
- Location
- Tag
- TagCategory
- Slot
- ExternalSlotMedia
- EmbedSlotMedia
- FileSlotMedia
Non-Resource Models
Non-resource models are dependent on another resource model to exist. For example, the path_history
model cannot be saved or deleted from the API. It simply represents meta-data from another model.
- PathHistory
Collections
Each resource model has a corresponding collection object. A collection object allows you to fetch groups of a resource model, an individual resource model, or groups of models that are related to the resource model.
Tests
Unit tests are located in the /tests
directory. Full coverage is in progress.
./vendor/bin/phpunit
Todo
- [x] Implement HttpClient interface
- [ ] Cache parsed model annotations
- [ ] Support directly associating objects along side UUIDs
- [ ] Make collections iterable
License
Released under the MIT license.