1. Go to this page and download the library: Download wyz/practicalafas 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/ */
wyz / practicalafas example snippets
use PracticalAfas\Connection;
use PracticalAfas\Client\RestCurlClient;
// This can be changed to SoapAppClient.
// Below 2 options are n example got calling a Get connector with simple filter, returning an
// array of data rows:
$result_as_array = $connection->getData('MyGetConnectorName', [ 'SomeCategory' => 'CategName' ] );
// A more elaborate example of filtering/sorting, and returning the response
// value as a string (JSON for REST client, or XML for SOAP client).
$result_as_string = $connection->getData(
'MyGetConnectorName',
[ 'SomeCategory' => 'CategName',
[ 'Updated' => '2017-01-01T16:00:00', '#op' => Connection::OP_LARGER_THAN ],
],
Connection::GET_FILTER_AND,
[ 'take' => 1000,
'orderbyfieldids' => '-Updated',
'options' => ['Outputmode' => Connection::GET_OUTPUTMODE_LITERAL ]
]
);
// Get a 'subject' (data blob):
$attachment = $connection->getData(123, [], Connection::DATA_TYPE_SUBJECT);
// This inserts a new organisation with only its name populated:
$connection->sendData(['name' => 'MyCompany Ltd.'], 'KnOrganisation', 'insert');