Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_ArrayUtility Class Reference

Provides utility methods for manipulating arrays. More...

List of all members.

Static Public Member Functions

static computeDiff ($old, $new)
 Compute the difference between two arrays.

Detailed Description

Provides utility methods for manipulating arrays.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

static P4Cms_ArrayUtility::computeDiff ( old,
new 
) [static]

Compute the difference between two arrays.

Parameters:
array$oldThe original array.
array$newThe new array.
Returns:
list $additions - An array of the items added to $old by $new $removals - An array of the items removed from $old by $new
    {
        $removals = array_merge(array_diff($old, $new));
        $additions = array_merge(array_diff($new, $old));
        return array($additions, $removals);
    }

The documentation for this class was generated from the following file: