PHP code example of nikos-ioannidis / softone

1. Go to this page and download the library: Download nikos-ioannidis/softone 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/ */

    

nikos-ioannidis / softone example snippets


use NikosIoannidis\Softone\SoftoneBrowser;

// Create a new instance
$softone = new SoftoneBrowser();

// Search for customers with a specific tax ID
$softone->search("CUSTOMER", 'CUSTOMER.AFM=000000000*=;');

// Or with named parameters
$softone->search(
    object: "CUSTOMER",
    filters: 'AFM=000000000=;',
    list: 'Web',
    start: 0,
    limit: 30
);

// Access the response data
foreach ($softone->responseData as $item) {
    echo $item['CUSTOMER.AFM'] . "\n";
    echo $item['CUSTOMER.NAME'] . "\n";
}

use NikosIoannidis\Softone\Softone;

// Create a new instance
$softone = new Softone();

// Get browser information
$softone->setService('getBrowserInfo');
$softone->setObject('CUSTOMER');
$softone->setFilters('CUSTOMER.AFM=000000*=;');
$softone->send();

// Get browser data using the request ID from the previous request
$softone->setService('getBrowserData');
$softone->setReqId($softone->reqID);
$softone->limit(10);
$softone->send();

// Access the response data
foreach ($softone->responseData as $item) {
    echo $item['CUSTOMER.NAME'] . "\n";
    echo $item['CUSTOMER.AFM'] . "\n";
}

use NikosIoannidis\Softone\SoftoneBrowser;

$softone = new SoftoneBrowser();

// Get selector data
$softone->getSelectorData('CUSTOMER', 'search term');

// Get specific fields from a table record
$softone->selectorFields('CUSTOMER', 'CUSTID', 27, 'NAME,AFM');

use NikosIoannidis\Softone\SoftoneBrowser;

$softone = new SoftoneBrowser();
$softone->search("CUSTOMER", 'CUSTOMER.NAME=*Company*=;');

foreach ($softone->responseData as $item) {
    echo "Customer ID: " . $item['CUSTOMER.CODE'] . "\n";
    echo "Customer Name: " . $item['CUSTOMER.NAME'] . "\n";
    echo "Tax ID: " . $item['CUSTOMER.AFM'] . "\n";
    echo "-------------------\n";
}

use NikosIoannidis\Softone\SoftoneBrowser;

$softone = new SoftoneBrowser();
$softone->getData('CUSTOMER', '1001');

$customer = $softone->response;
echo "Customer Name: " . $customer->NAME . "\n";
echo "Tax ID: " . $customer->AFM . "\n";
bash
php artisan vendor:publish --provider="NikosIoannidis\Softone\SoftoneServiceProvider"