Download the PHP package heydon/uarray without Composer
On this page you can find all versions of the php package heydon/uarray. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heydon/uarray
More information about heydon/uarray
Files in heydon/uarray
Package uarray
Short Description Allow manipulation of PICK Dynamic Arrays in PHP for use with RockSoftware's U2 products
License MIT
Homepage https://github.com/gheydon/uarray
Informations about the package uarray
uArray 
Allow manipulation of PICK Dynamic Arrays in PHP
PICK Dynamic Arrays are how the PICK operating system stores arrays in the database. The data itself is a single text string with delimiters inserted with the string to break the string up into different fields.
- Attribute Mark AM (\xfe) ^
- Value Make VM (\xfd) ]
- Sub Value Mark SVM (\xdc) \
These marks allow the system to break up the string into the fields which can be used by the system to indicate the fields and recurring values.
Installation
Installation via composer is the only method supported at this stage. Edit your composer.json to add the following.
Example Variable
Example Code
Setting a value
In PICK BASIC you would do the following to insert a value
in PHP the following will be done.
the result of this would be the same as the PICK equivilent.
unsetting a value
PICK/u2 doesn't really have a delete value, which will delete the value and not having "sliding delimiters". so in PICK/u2 BASIC you would do something like
In PHP this can be done 2 ways.
Inserting values
To insert values into an array which in PICK/u2 you would do the following.
and in PHP the following will be done.
Deleting values
When deleting a value in PICK the following is done.
to do the equivilent in PHP
Associated Arrays
Dynamic arrays in PICK/u2 and PHP are fundermentally different. The following is an example of how a basic invoice would be reprsented in PICK/u2
Where in this example the line 1 is the item number, 2 is the item name, and 3 is the cost. But in PHP this same array would be represented this in the following way.
Keeping the attributes in alignment is not very easy or very natural in PHP, so the ::fetchAssoc() has been created to allow easier manipulation of the PICK/u2 associated array.
Any object which implements the uAssocArraySource can implement the fetchAssoc() method.
Checking for changes.
Since the uArray was primarily built to work with RedBack, there needed to be the ability to capture changes so they can be sent to the backend server. The Taint flag was created and can be reset when needed to allow to detect changes during a specific period.