Oara\Network\Publisher\AffiliNet::getMerchantList PHP Method

getMerchantList() public method

public getMerchantList ( ) : array
return array
    public function getMerchantList()
    {
        $merchantListResult = array();
        //Set the webservice
        $publisherProgramServiceUrl = 'https://api.affili.net/V2.0/PublisherProgram.svc?wsdl';
        $publisherProgramService = new \SoapClient($publisherProgramServiceUrl, array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE, 'soap_version' => SOAP_1_1));
        //Call the function
        $params = array('Query' => '');
        $merchantList = self::affilinetCall('merchant', $publisherProgramService, $params);
        if ($merchantList->TotalRecords > 0) {
            if ($merchantList->TotalRecords == 1) {
                $merchant = $merchantList->Programs->ProgramSummary;
                $merchantList = array();
                $merchantList[] = $merchant;
            } else {
                $merchantList = $merchantList->Programs->ProgramSummary;
            }
            foreach ($merchantList as $merchant) {
                $obj = array();
                $obj['cid'] = $merchant->ProgramId;
                $obj['name'] = $merchant->ProgramTitle;
                $obj['url'] = $merchant->Url;
                $merchantListResult[] = $obj;
            }
        } else {
            $merchantListResult = array();
        }
        return $merchantListResult;
    }