Skip to content

Commit

Permalink
Merge branch 'getArticleGroups_retrieveArticleNumbers_option' into 'm…
Browse files Browse the repository at this point in the history
…aster'

getArticleGroups add retrieveArticleNumbers option

See merge request mpluskassa/mplus-api-client-deprecated!58
  • Loading branch information
dennismpluskassa committed Feb 4, 2021
2 parents 55650e0 + c60f698 commit 837cbe5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Mplusqapiclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class MplusQAPIclient
{
const CLIENT_VERSION = '1.34.4';
const CLIENT_VERSION = '1.34.5';
const WSDL_TTL = 300;

var $MIN_API_VERSION_MAJOR = 0;
Expand Down Expand Up @@ -1673,10 +1673,10 @@ public function updateProduct($product)

//----------------------------------------------------------------------------

public function getArticleGroups($groupNumbers=array(), $syncMarker=null, $syncMarkerLimit=null, $attempts=0)
public function getArticleGroups($groupNumbers=array(), $syncMarker=null, $syncMarkerLimit=null, $retrieveArticleNumbers=null, $attempts=0)
{
try {
$result = $this->client->getArticleGroups($this->parser->convertGetArticleGroupsRequest($groupNumbers, $syncMarker, $syncMarkerLimit));
$result = $this->client->getArticleGroups($this->parser->convertGetArticleGroupsRequest($groupNumbers, $syncMarker, $syncMarkerLimit, $retrieveArticleNumbers));
if($this->returnRawResult) {
return $result;
}
Expand All @@ -1685,7 +1685,7 @@ public function getArticleGroups($groupNumbers=array(), $syncMarker=null, $syncM
$msg = $e->getMessage();
if (false !== stripos($msg, 'Could not connect to host') and $attempts < 3) {
sleep(1);
return $this->getArticleGroups($groupNumbers, $syncMarker, $syncMarkerLimit, $attempts+1);
return $this->getArticleGroups($groupNumbers, $syncMarker, $syncMarkerLimit, $retrieveArticleNumbers, $attempts+1);
} else {
throw new MplusQAPIException('SoapFault occurred: '.$msg, 0, $e);
}
Expand Down Expand Up @@ -8364,7 +8364,7 @@ public function convertBarcodes($barcodes)

//----------------------------------------------------------------------------

public function convertGetArticleGroupsRequest($groupNumbers, $syncMarker, $syncMarkerLimit)
public function convertGetArticleGroupsRequest($groupNumbers, $syncMarker, $syncMarkerLimit, $retrieveArticleNumbers)
{
$request = array();
if ( ! is_array($groupNumbers)) {
Expand All @@ -8377,6 +8377,9 @@ public function convertGetArticleGroupsRequest($groupNumbers, $syncMarker, $sync
if ( ! is_null($syncMarkerLimit)) {
$request['syncMarkerLimit'] = $syncMarkerLimit;
}
if ( ! is_null($retrieveArticleNumbers)) {
$request['retrieveArticleNumbers'] = $retrieveArticleNumbers;
}
$object = arrayToObject(array('request'=>$request));
return $object;
} // END convertGetArticleGroupsRequest()
Expand Down

0 comments on commit 837cbe5

Please sign in to comment.