_ _ _ ___ ______ _____
| | (_) | | / _ \ | ___ \_ _|
| | _ _ __ ___ __| | ___/ /_\ \| |_/ / | |
| | | | '_ \ / _ \ / _` |/ _ \ _ || __/ | |
| |___| | | | | (_) | (_| | __/ | | || | _| |_
\_____/_|_| |_|\___/ \__,_|\___\_| |_/\_| \___/
The v4.01 Linode API for PHP [BETA]., (*1)
Definately a work in progress. Do not use., (*2)
, (*3)
, (*4)
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital., (*5)
This package is built automatically using the OpenAPI specification for the Linode v4 API., (*6)
Documentation
Requirements
Install
Via composer:, (*7)
$ composer require hnhdigital-os/php-linode-api dev-master, (*8)
Examples
Regions
Results returned from any search based endpoint are provided as an instance of that type. This allows you to call any endpoints immediately., (*9)
Results from the get method are returned as an object that implements Iterator and Countable, allowing you to use this in a foreach and to use count. Linode limits search results to 25 records per page - this is overcome by automatically requesting the next page of records when the last record is reached in the current page., (*10)
foreach ((new Regions())->get() as $region) {
// Do something with the region data (returned as an instance of Region)
}
Calling the all method automatically loads every page of results., (*11)
$regions = (new Regions())->get()->all();
Region
You can get a specific record, simply by creating the object with the required parameters. This will automatically call the endpoint and return the object ready to use. The record will auto-load by setting the last parameter to true., (*12)
$region = new Region('us-east-1a', true);
echo $region->id.' ('.$region->country.')';
us-east-1a (US)
Calling the `get` method directly on this same class will return an array of the values from the same endpoint. This will also auto-fill the object (the same as above, passing the true actually just calls the get method).
```php
$result = (new Region('us-east-1a'))->get();
print_r($result);
Array
(
[id] => us-east-1a
[country] => US
)
```, (*13)
Contributing
Please see CONTRIBUTING for details., (*14)
Credits
License
The MIT License (MIT). Please see License File for more information., (*15)