PHP code example of stelzer / php-powerlink

1. Go to this page and download the library: Download stelzer/php-powerlink library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stelzer / php-powerlink example snippets




werLink\PowerLink as API;

$payload = array('your payload');
$token_id = '<YOUR TOKEN ID>';
$client = new API($token_id);

$client->create();

$object_type = 'crmorder';
$params = array('your object');
$client->create($object_type, $params);

$object_type = 'crmorder';
$object_id = 1;
$params = array('your object');
$client->update($object_type, $object_id, $params);

$client->delete($object_type, $object_id);

use \PowerLink\PowerLink as API;
use \PowerLink\Query;

$token_id = '<YOUR TOKEN ID>';
$client = new API($token_id);

$query = new Query();
$query->setQuery(array(
    array('name', '=', '10'), 'AND', array('second_field', '>=', 20)
));

$query->setPageNumger(2);
$query->setPageSize(20);
$query->setFields(array('first_field', 'second_field'));
$query->setOrderBy('third_field', 'asc');

$client->query($query);
bash
composer