PHP code example of think.studio / laravel-myriad-soap

1. Go to this page and download the library: Download think.studio/laravel-myriad-soap 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/ */

    

think.studio / laravel-myriad-soap example snippets


MyriadSoap::SOAP_getContactCommunications_List(['Contact_ID' => 1234], 3, 'ContactCommunication' /* Optional, as appropriate key, app will try guess itself */);

MyriadSoap::SOAP_getContactCommunications_Collection(['Contact_ID' => 1234], [
        'ContactCommunication_ID' => fn($i) => (int) $i,
        'DespatchType_ID' => fn($i) => (int) $i,
        'ContactCommunication',
        'PrimaryUse'              => fn($i) => $i == 'Yes',
    ], 'ContactCommunication' /* Optional, as appropriate key, app will try guess itself */);

MyriadSoap::SOAP_getOrderPackageTypes_AssocCollection([], [
            'OrderPackageType_ID' => fn($i) => (int) tap($i, fn() => throw_if(! is_numeric($i), UnexpectedTypeException::class)),
            'OrderPackageType' => fn($i) => (string) $i,
            'OrderPackageCategory',
        ], 'OrderPackageType' /* Optional, as appropriate key, app will try guess itself */);
injectablephp
use MyriadSoap\Endpoints\FunctionsSet;

class MyContactFunctions extends FunctionsSet {

    public function getContactCommunications( int $customerNumber ) {
        return $this->api->call(
            'SOAP_getContactCommunications',
            [
                'Contact_ID' => $customerNumber,
            ]
        );
    }
}

$result =  MyriadSoap::functionsSet(MyContactFunctions::class)->getContactCommunications(1234);