arbor-education / arbor-sdk-php
Arbor Education PHP SDK
Installs: 2 517
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 5
Open Issues: 1
Requires
- php: >=7.1.0
- ext-json: *
- guzzlehttp/guzzle: ^6.0 || ^7.0
Requires (Dev)
- arbor-education/php-coding-standard: >=1
- fakerphp/faker: ^v1.19.0
- phpunit/phpunit: >=4.7
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.0
- 5.0.2
- 5.0.1
- 5.0.0
- 4.9.0
- 4.8.1
- 4.8.0
- 4.7.2
- 4.7.1
- 4.7.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.4.1
- 2.4.0
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- dev-master / 2.0.x-dev
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.0
- 1.0.0
- dev-license
- dev-alter-workflow-triggers
- dev-feature/2023-06-update
- dev-feature/IT-10204
This package is auto-updated.
Last update: 2024-11-13 13:48:14 UTC
README
Arbor Education SDK library.
Introduction
PHP SDK is a library which simplifies the process of integrating the Arbor REST API with your own software.
Rather than handling XML and making HTTP requests in your code, you can simply include the SDK and use getters and setters on models in order to access data from Arbor. PHP SDK includes hundreds of models as well as a gateway pattern for querying the API via a query model.
Requirements
- PHP 7.1 or higher
- Composer
Installation
Simply download the project and run composer install
from the root of the project to use as standalone for testing purposes.
Find the latest version on Packagist Arbor Education - PHP SDK and install it with composer directly in your project composer require arbor-education/arbor-sdk-php
Once setup use the examples/config-dist.php
to create your own config. For this you will need your apps credentials added on Arbor Education - Developers Portal in order to be able to make requests to a sandbox environment.
Usage
In the examples/example-bootstrap
you will find the configuration needed to make requests, either using it directly from examples/config.php
or using your own configuration. The entire examples
directory is focused on helping you develop your app faster. Scripts written represent some of the most frequently used queries.
Example
Use Arbor\Api\Gateway\RestGateway
to make GET, POST, PUT and DELETE requests and use Arbor\Query\Query
to add filters to your requests.
GET request:
$student = \Arbor\Model\Student::retrieve(16);
or use examples/student-retrieve.php to see how to retrieve a record.
POST request:
use examples/staff-create.php to see how to create a new record.
PUT request:
use examples/staff-create.php to see how to update an existing record.
DELETE request:
$api->delete($staff->getPerson()); // assuming that you are deleting your newly created staff record
Query filters:
List of filters can be found in Arbor\Query\Query
$query = new \Arbor\Query\Query(Arbor\Resource\ResourceType::ARBOR_MODEL); $query->addPropertyFilter(ArborModel::PROPERTY_NAME, OPERATOR, $value); $query->addPropertyFilter(ArborModel::PROPERTY_NAME, SECOND_OPERATOR, $value); ... $records = \Arbor\Model\ArborModel::query($query); // will return an array of records foreach ($records as $record) { // e.g. $record->getDisplayName(); }
Check examples
directory to see usages of filters.