From 3455f804a500744e72e56644d55d26668239a481 Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Mon, 1 Jul 2024 13:40:09 +1000 Subject: [PATCH 1/6] Add Page Size and Page Info --- src/XeroPHP/Remote/PageInfo.php | 69 +++++++++++++++++++++++++++++++++ src/XeroPHP/Remote/Query.php | 29 ++++++++++++++ src/XeroPHP/Remote/Response.php | 21 +++++++++- 3 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 src/XeroPHP/Remote/PageInfo.php diff --git a/src/XeroPHP/Remote/PageInfo.php b/src/XeroPHP/Remote/PageInfo.php new file mode 100644 index 00000000..9346ab83 --- /dev/null +++ b/src/XeroPHP/Remote/PageInfo.php @@ -0,0 +1,69 @@ + + * 1 + * 1000 + * 2 + * 1275 + * + */ +class PageInfo +{ + private int $page; + private int $pageSize; + private int $totalPages; + private int $totalRows; + + public function getPage(): int + { + return $this->page; + } + + public function setPage($value): self + { + $this->page = $value; + + return $this; + } + + + public function getPageSize(): int + { + return $this->pageSize; + } + + public function setPageSize($value): self + { + $this->pageSize = $value; + + return $this; + } + + public function getTotalPages(): int + { + return $this->totalPages; + } + + public function setTotalPages($value): self + { + $this->totalPages = $value; + + return $this; + } + + public function getTotalRows(): int + { + return $this->totalRows; + } + + public function setTotalRows($value): self + { + $this->totalRows = $value; + + return $this; + } +} diff --git a/src/XeroPHP/Remote/Query.php b/src/XeroPHP/Remote/Query.php index 5bdc896e..40805732 100644 --- a/src/XeroPHP/Remote/Query.php +++ b/src/XeroPHP/Remote/Query.php @@ -24,6 +24,8 @@ class Query private $page; + private $pageSize; + private $fromDate; private $toDate; @@ -48,6 +50,7 @@ public function __construct(Application $app) $this->order = null; $this->modifiedAfter = null; $this->page = null; + $this->pageSize = null; $this->offset = null; $this->includeArchived = false; $this->createdByMyApp = false; @@ -236,6 +239,28 @@ public function page($page = 1) return $this; } + + /** + * @param int $pageSize + * + * @throws Exception + * + * @return $this + */ + public function pageSize($pageSize = 100) + { + /** + * @var ObjectInterface + */ + $from_class = $this->from_class; + if (! $from_class::isPageable()) { + throw new Exception(sprintf('%s does not support paging.', $from_class)); + } + $this->pageSize = (int) $pageSize; + + return $this; + } + /** * @param int $offset * @@ -321,6 +346,10 @@ public function execute() $request->setParameter('page', $this->page); } + if ($this->pageSize !== null) { + $request->setParameter('pageSize', $this->pageSize); + } + if ($this->offset !== null) { $request->setParameter('offset', $this->offset); } diff --git a/src/XeroPHP/Remote/Response.php b/src/XeroPHP/Remote/Response.php index b5570187..932a726f 100644 --- a/src/XeroPHP/Remote/Response.php +++ b/src/XeroPHP/Remote/Response.php @@ -74,6 +74,8 @@ class Response private $root_warnings; + private $pageInfo; + public function __construct(Request $request, $response_body, $status, $headers) { $this->request = $request; @@ -318,7 +320,12 @@ public function parseXML() foreach ($sxml as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': - // TODO: We can potentially handle the page info and make it a value on the response object + $this->pageInfo = (new PageInfo()) + ->setPage((int)$root_child->Page) + ->setPageSize((int)$root_child->PageSize) + ->setTotalPages((int)$root_child->TotalPages) + ->setTotalRows((int)$root_child->TotalRows); + break; case 'ErrorNumber': $this->root_error['code'] = (string)$root_child; @@ -365,7 +372,12 @@ public function parseJSON() foreach ($json as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': - // TODO: We can potentially handle the page info and make it a value on the response object + $this->pageInfo = (new PageInfo()) + ->setPage($root_child['Page']) + ->setPageSize($root_child['PageSize']) + ->setTotalPages($root_child['TotalPages']) + ->setTotalRows($root_child['TotalRows']); + break; case 'ErrorNumber': $this->root_error['code'] = $root_child; @@ -411,4 +423,9 @@ public function parseHTML() { parse_str($this->response_body, $this->oauth_response); } + + public function getPageInfo(): PageInfo + { + return $this->pageInfo; + } } From 2a2f73c6e61416986cddca8365ef10268016c7be Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Wed, 17 Jul 2024 08:28:56 +1000 Subject: [PATCH 2/6] Addition of New Fields for XPM Client --- src/XeroPHP/Models/PracticeManager/Client.php | 357 +++++++++++------- .../Client/AutoBasOptInCriteria.php | 81 ++++ 2 files changed, 296 insertions(+), 142 deletions(-) create mode 100644 src/XeroPHP/Models/PracticeManager/Client/AutoBasOptInCriteria.php diff --git a/src/XeroPHP/Models/PracticeManager/Client.php b/src/XeroPHP/Models/PracticeManager/Client.php index 3e23379c..01fa975b 100644 --- a/src/XeroPHP/Models/PracticeManager/Client.php +++ b/src/XeroPHP/Models/PracticeManager/Client.php @@ -3,6 +3,7 @@ namespace XeroPHP\Models\PracticeManager; use XeroPHP\Models\PracticeManager\Client\AccountManager; +use XeroPHP\Models\PracticeManager\Client\AutoBasOptInCriteria; use XeroPHP\Models\PracticeManager\Client\BillingClient; use XeroPHP\Models\PracticeManager\Client\Contact; use XeroPHP\Models\PracticeManager\Client\Group; @@ -18,76 +19,37 @@ class Client extends Remote\Model use CustomFieldValueTrait; /** - * Xero identifier. - * * @property string ID - */ - - /** - * Full name of Client/organisation (max length = 255). - * * @property string Name - */ - - /** - * First name of Client person (max length = 255). - * + * @property string Title * @property string FirstName - */ - - /** - * Last name of Client person (max length = 255). - * * @property string LastName - */ - - /** - * Other name of Client person (max length = 255). - * * @property string OtherName - */ - - /** - * Date of birth of Client person (max length = 255). - * * @property string DateOfBirth - */ - - /** - * Email address of Client person (umlauts not supported) (max length = 255). - * * @property string Email - */ - - /** - * Physical Address * @property string Address * @property string City * @property string Region * @property string PostCode * @property string Country - */ - - /** - * Postal Address * @property string PostalAddress * @property string PostalCity * @property string PostalRegion * @property string PostalPostCode * @property string PostalCountry - */ - - /** * @property string Phone * @property string Fax * @property string Website * @property string ReferralSource * @property string ExportCode * @property string IsProspect + * @property string IsDeleted + * @property string IsArchived * where the tax number is masked with *** except last 3 digits * @property string TaxNumber * @property string CompanyNumber * @property string BusinessNumber + * @property string BranchNumber * e.g. Individual, Company, Trust, etc * @property string BusinessStructure * @property string BalanceMonth @@ -109,71 +71,26 @@ class Client extends Remote\Model * @property string AgencyStatus * IR3, IR3NR, IR4, IR6, IR7, IR9, PTS * @property string ReturnType - * * The following fields apply to AU clients only * Yes or No * @property string PrepareActivityStatement * Yes or No * @property string PrepareTaxReturn - * - * + * @property string ActiveAtoClient + * @property string ClientCode * @property string AgencyStatus * @property string AgencyStatus - */ - - /** - * See Client contacts. * + * Related Objects * @property Contact[] Contacts - */ - - /** - * See Account Manager. - * * @property AccountManager AccountManager - * - */ - - /** - * See Job Manager. - * * @property JobManager JobManager - * - */ - - /** - * See Type - * + * @property AutoBasOptInCriteria AutoBasOptInCriteria * @property Type Type - * - */ - - /** - * See BillingClient - * * @property BillingClient BillingClient - * - */ - - /** - * See Note - * - * @property Note[] Note - * - */ - - /** - * See Group - * - * @property Group[] Group - * - */ - - /** - * See Relationship - * + * @property Note[] Notes + * @property Group[] Groups * @property Relationship[] Relationship - * */ /** @@ -248,6 +165,7 @@ public static function getProperties() return [ 'ID' => [false, self::PROPERTY_TYPE_INT, null, false, false], 'Name' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'Title' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'FirstName' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'LastName' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'OtherName' => [false, self::PROPERTY_TYPE_STRING, null, false, false], @@ -269,9 +187,12 @@ public static function getProperties() 'ReferralSource' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'ExportCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'IsProspect' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'IsArchived' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'IsDeleted' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'TaxNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'CompanyNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'BusinessNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'BranchNumber' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'BusinessStructure' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], 'BalanceMonth' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'PrepareGST' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], @@ -286,12 +207,15 @@ public static function getProperties() 'ReturnType' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], 'PrepareActivityStatement' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], 'PrepareTaxReturn' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], + 'ActiveAtoClient' => [false, self::PROPERTY_TYPE_ENUM, null, false, false], + 'ClientCode' => [false, self::PROPERTY_TYPE_STRING, null, false, false], 'Contacts' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\Contact', true, false], 'Notes' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\Note', true, false], 'Groups' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\Group', true, false], 'Relationships' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\Relationship', true, false], 'AccountManager' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\AccountManager', false, false], 'JobManager' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\JobManager', false, false], + 'AutoBasOptInCriteria' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\AutoBasOptInCriteria', false, false], 'Type' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\Type', false, false], 'BillingClient' => [false, self::PROPERTY_TYPE_OBJECT, 'PracticeManager\\Client\\BillingClient', false, false], ]; @@ -311,7 +235,7 @@ public function getID() } /** - * @param int $value + * @param int $value * * @return Client */ @@ -332,7 +256,7 @@ public function getName() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -344,6 +268,27 @@ public function setName($value) return $this; } + /** + * @return string + */ + public function getTitle() + { + return $this->_data['Title']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setTitle($value) + { + $this->propertyUpdated('Title', $value); + $this->_data['Title'] = $value; + + return $this; + } + /** * @return string */ @@ -353,7 +298,7 @@ public function getFirstName() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -374,7 +319,7 @@ public function getLastName() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -395,7 +340,7 @@ public function getOtherName() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -416,7 +361,7 @@ public function getDateOfBirth() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -437,7 +382,7 @@ public function getEmail() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -458,7 +403,7 @@ public function getAddress() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -479,7 +424,7 @@ public function getCity() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -500,7 +445,7 @@ public function getRegion() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -521,7 +466,7 @@ public function getPostCode() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -542,7 +487,7 @@ public function getCountry() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -563,7 +508,7 @@ public function getPostalAddress() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -584,7 +529,7 @@ public function getPostalCity() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -605,7 +550,7 @@ public function getPostalRegion() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -626,7 +571,7 @@ public function getPostalPostCode() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -647,7 +592,7 @@ public function getPostalCountry() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -668,7 +613,7 @@ public function getPhone() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -689,7 +634,7 @@ public function getFax() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -710,7 +655,7 @@ public function getWebsite() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -731,7 +676,7 @@ public function getReferralSource() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -752,7 +697,7 @@ public function getExportCode() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -773,7 +718,7 @@ public function getIsProspect() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -785,6 +730,50 @@ public function setIsProspect($value) return $this; } + + /** + * @return string + */ + public function getIsArchived() + { + return $this->_data['IsArchived']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setIsArchived($value) + { + $this->propertyUpdated('IsArchived', $value); + $this->_data['IsArchived'] = $value; + + return $this; + } + + + /** + * @return string + */ + public function getIsDeleted() + { + return $this->_data['IsDeleted']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setIsDeleted($value) + { + $this->propertyUpdated('IsDeleted', $value); + $this->_data['IsDeleted'] = $value; + + return $this; + } + /** * @return string */ @@ -794,7 +783,7 @@ public function getTaxNumber() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -815,7 +804,7 @@ public function getCompanyNumber() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -836,7 +825,7 @@ public function getBusinessNumber() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -848,6 +837,27 @@ public function setBusinessNumber($value) return $this; } + /** + * @return string + */ + public function getBranchNumber() + { + return $this->_data['BranchNumber']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setBranchNumber($value) + { + $this->propertyUpdated('BranchNumber', $value); + $this->_data['BranchNumber'] = $value; + + return $this; + } + /** * @return string */ @@ -857,7 +867,7 @@ public function getBusinessStructure() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -878,7 +888,7 @@ public function getBalanceMonth() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -899,7 +909,7 @@ public function getPrepareGST() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -920,7 +930,7 @@ public function getGSTRegistered() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -941,7 +951,7 @@ public function getGSTPeriod() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -962,7 +972,7 @@ public function getGSTBasis() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -983,7 +993,7 @@ public function getProvisionalTaxBasis() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1004,7 +1014,7 @@ public function getProvisionalTaxRatio() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1025,7 +1035,7 @@ public function getSignedTaxAuthority() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1046,7 +1056,7 @@ public function getTaxAgent() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1067,7 +1077,7 @@ public function getAgencyStatus() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1088,7 +1098,7 @@ public function getReturnType() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1109,7 +1119,7 @@ public function getPrepareActivityStatement() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1130,7 +1140,7 @@ public function getPrepareTaxReturn() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1142,6 +1152,48 @@ public function setPrepareTaxReturn($value) return $this; } + /** + * @return string + */ + public function getActiveAtoClient() + { + return $this->_data['ActiveAtoClient']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setActiveAtoClient($value) + { + $this->propertyUpdated('ActiveAtoClient', $value); + $this->_data['ActiveAtoClient'] = $value; + + return $this; + } + + /** + * @return string + */ + public function getClientCode() + { + return $this->_data['ClientCode']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setClientCode($value) + { + $this->propertyUpdated('ClientCode', $value); + $this->_data['ClientCode'] = $value; + + return $this; + } + /** * @return Contact[]|Remote\Collection */ @@ -1151,7 +1203,7 @@ public function getContacts() } /** - * @param Contact $value + * @param Contact $value * * @return Client */ @@ -1175,7 +1227,7 @@ public function getNotes() } /** - * @param Note $value + * @param Note $value * * @return Client */ @@ -1199,7 +1251,7 @@ public function getGroups() } /** - * @param Group $value + * @param Group $value * * @return Client */ @@ -1223,7 +1275,7 @@ public function getRelationships() } /** - * @param Relationship $value + * @param Relationship $value * * @return Client */ @@ -1247,7 +1299,7 @@ public function getAccountManager() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1268,7 +1320,7 @@ public function getJobManager() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1280,6 +1332,27 @@ public function setJobManager($value) return $this; } + /** + * @return AutoBasOptInCriteria + */ + public function getAutoBasOptInCriteria() + { + return $this->_data['AutoBasOptInCriteria']; + } + + /** + * @param string $value + * + * @return Client + */ + public function setAutoBasOptInCriteria($value) + { + $this->propertyUpdated('AutoBasOptInCriteria', $value); + $this->_data['AutoBasOptInCriteria'] = $value; + + return $this; + } + /** * @return string */ @@ -1289,7 +1362,7 @@ public function getType() } /** - * @param string $value + * @param string $value * * @return Client */ @@ -1310,7 +1383,7 @@ public function getBillingClient() } /** - * @param string $value + * @param string $value * * @return Client */ diff --git a/src/XeroPHP/Models/PracticeManager/Client/AutoBasOptInCriteria.php b/src/XeroPHP/Models/PracticeManager/Client/AutoBasOptInCriteria.php new file mode 100644 index 00000000..ca17bfcc --- /dev/null +++ b/src/XeroPHP/Models/PracticeManager/Client/AutoBasOptInCriteria.php @@ -0,0 +1,81 @@ + [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'Monthly' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'Quarterly' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + 'Opt-Out' => [false, self::PROPERTY_TYPE_STRING, null, false, false], + ]; + } + + public static function isPageable() + { + return false; + } +} From 3ddaa75ddaae8fb35a15bf63ada085fdf8ec2a21 Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Wed, 17 Jul 2024 08:31:38 +1000 Subject: [PATCH 3/6] Removal of PageInfo --- src/XeroPHP/Remote/Response.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/XeroPHP/Remote/Response.php b/src/XeroPHP/Remote/Response.php index 932a726f..6c268fab 100644 --- a/src/XeroPHP/Remote/Response.php +++ b/src/XeroPHP/Remote/Response.php @@ -74,8 +74,6 @@ class Response private $root_warnings; - private $pageInfo; - public function __construct(Request $request, $response_body, $status, $headers) { $this->request = $request; @@ -320,11 +318,7 @@ public function parseXML() foreach ($sxml as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': - $this->pageInfo = (new PageInfo()) - ->setPage((int)$root_child->Page) - ->setPageSize((int)$root_child->PageSize) - ->setTotalPages((int)$root_child->TotalPages) - ->setTotalRows((int)$root_child->TotalRows); + // TODO: We can potentially handle the page info and make it a value on the response object break; case 'ErrorNumber': @@ -372,11 +366,7 @@ public function parseJSON() foreach ($json as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': - $this->pageInfo = (new PageInfo()) - ->setPage($root_child['Page']) - ->setPageSize($root_child['PageSize']) - ->setTotalPages($root_child['TotalPages']) - ->setTotalRows($root_child['TotalRows']); + // TODO: We can potentially handle the page info and make it a value on the response object break; case 'ErrorNumber': @@ -423,9 +413,4 @@ public function parseHTML() { parse_str($this->response_body, $this->oauth_response); } - - public function getPageInfo(): PageInfo - { - return $this->pageInfo; - } } From 8de798c2762dbe6f69d4fc0dfbdbef4aad3feb79 Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Wed, 17 Jul 2024 08:32:08 +1000 Subject: [PATCH 4/6] Removal of PageInfo --- src/XeroPHP/Remote/PageInfo.php | 69 --------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 src/XeroPHP/Remote/PageInfo.php diff --git a/src/XeroPHP/Remote/PageInfo.php b/src/XeroPHP/Remote/PageInfo.php deleted file mode 100644 index 9346ab83..00000000 --- a/src/XeroPHP/Remote/PageInfo.php +++ /dev/null @@ -1,69 +0,0 @@ - - * 1 - * 1000 - * 2 - * 1275 - * - */ -class PageInfo -{ - private int $page; - private int $pageSize; - private int $totalPages; - private int $totalRows; - - public function getPage(): int - { - return $this->page; - } - - public function setPage($value): self - { - $this->page = $value; - - return $this; - } - - - public function getPageSize(): int - { - return $this->pageSize; - } - - public function setPageSize($value): self - { - $this->pageSize = $value; - - return $this; - } - - public function getTotalPages(): int - { - return $this->totalPages; - } - - public function setTotalPages($value): self - { - $this->totalPages = $value; - - return $this; - } - - public function getTotalRows(): int - { - return $this->totalRows; - } - - public function setTotalRows($value): self - { - $this->totalRows = $value; - - return $this; - } -} From 1a80dec43c8326d1a2bcf8d7a7ca98c61e9fcc55 Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Wed, 17 Jul 2024 08:32:36 +1000 Subject: [PATCH 5/6] Removal of PageInfo --- src/XeroPHP/Remote/Response.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/XeroPHP/Remote/Response.php b/src/XeroPHP/Remote/Response.php index 6c268fab..b5570187 100644 --- a/src/XeroPHP/Remote/Response.php +++ b/src/XeroPHP/Remote/Response.php @@ -319,7 +319,6 @@ public function parseXML() switch ($child_index) { case 'PageInfo': // TODO: We can potentially handle the page info and make it a value on the response object - break; case 'ErrorNumber': $this->root_error['code'] = (string)$root_child; @@ -367,7 +366,6 @@ public function parseJSON() switch ($child_index) { case 'PageInfo': // TODO: We can potentially handle the page info and make it a value on the response object - break; case 'ErrorNumber': $this->root_error['code'] = $root_child; From 4b3358b344c93dea9cae0d391a348da7456c7b85 Mon Sep 17 00:00:00 2001 From: Brett Bailey Date: Wed, 17 Jul 2024 10:11:48 +1000 Subject: [PATCH 6/6] Fixed to handle the newest value of the pagination response --- src/XeroPHP/Remote/Response.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/XeroPHP/Remote/Response.php b/src/XeroPHP/Remote/Response.php index b5570187..db818ec8 100644 --- a/src/XeroPHP/Remote/Response.php +++ b/src/XeroPHP/Remote/Response.php @@ -318,6 +318,7 @@ public function parseXML() foreach ($sxml as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': + case 'pagination': // TODO: We can potentially handle the page info and make it a value on the response object break; case 'ErrorNumber': @@ -365,6 +366,7 @@ public function parseJSON() foreach ($json as $child_index => $root_child) { switch ($child_index) { case 'PageInfo': + case 'pagination': // TODO: We can potentially handle the page info and make it a value on the response object break; case 'ErrorNumber':