Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Zon Core Zon Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Custom D
  • Zon CoreZon Core
  • Merge requests
  • !176

Open
Created Jul 01, 2019 by Robert Sinton@robertMaintainer
  • Report abuse
Report abuse

Feature/xero handle data lists

  • Overview 2
  • Commits 4
  • Changes 1

The issue

The DF_Xero library used array2xml to produce the XML for Xero objects. This chokes on data objects that contain lists of multiple sub-objects. Examples include the <Addresses> and <Phones> elements when creating a new Xero contact.

With this change, a flat array (no keys, or numeric keys) can be supplied as part of a data object. The parent element name will be singularized to provide the XML subelement names.

e.g.

[
    'Addresses' => [
        {address data array},
        {address data array}
    ]
]

==>

<Addresses><Address>{address data}</Address><Address>{address data</Address></Addresses>

What I did

  • Replaced the existing array->xml dependency with some 'borrowed' methods that allow for data elements that contain lists of subelements.
    • Methods came from a recommended third-party library we have used in Art Money: https://github.com/calcinai/xero-php

Implications

None

Setup

None

How to test

  • Code review.
  • Can be tested with commit 62c34e40a5c06ad29c4242630c98d059072e3537 in the National Weighing Xero integration project, but might be easier to OTS it at first opportunity.
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/xero_handle_data_lists