devless / php-sdk
Official Devless SDK
Installs: 5 871
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 5
Forks: 4
Open Issues: 0
Requires
- php: >=5.5.9
Requires (Dev)
- phpunit/phpunit: >=5.3.2
This package is not auto-updated.
Last update: 2024-04-17 17:34:48 UTC
README
Install
Via Composer
$ composer require devless/php-sdk
DV-PHP-SDK
Official Devless php sdk
Getting started
To connect to the Devless instance
use Devless\SDK\SDK;
$devless = new SDK("http://example.com", "1234567abcdefghijklmnopqrst");
To add data to table
$devless->addData('service_name', 'service_table', ['name'=>'james']);
To query data from the Devless instance
$results = $devless->getData('service_name','service-table');
var_dump($results);
Also you may filter your query with :
size
: determine the number of results to return
eg: $results = $devless->size(3)->getData('service_name', 'service_table');
offset
: Set step in data data to be sent back
NB: This is to be used in combination with size
`` eg: $results = $devless->offset(2)->size(6)->getData('service_name', 'service_table'); ```
where
: Get data based on where a key matches a certain value
eg: $results = $devless->where('name', 'edmond')->getData('service_name', 'service_table');
orWhere
: Get a combination of results using a particular identifier from the table
eg: $results = $devless->orWhere('name', 'edmond')->getData('service_name', 'service_table');
orderBy
: Order incoming results in descending order based on a key
eg: $results = $devless->orderBy('name')->getData('service_name', 'service_table');
To update data to table
$devless->where('id',1)->updateData('service_name', 'service_table', ['name'=>'edmond']);
To delete data from a Devless instance
$devless->where('id',1)->deleteData('service_name','service_table');
Make a call to an Action Class
$devless->call('service_name','method_name',[params]);
Authenticating with a Devless instance
$token = $devless->call('devless','login',['email'=>'k@gmail.com','password'=>'password'])['token'];
$devless->setUserToken($token['payload']['result']);