lithium\data\source\mongo_db\Exporter::_diff PHP Method

_diff() protected static method

Handle diffing operations between Document object states. Implemented because all of PHP's array comparison functions are broken when working with objects.
protected static _diff ( array $left, array $right ) : array
$left array The left-hand comparison array.
$right array The right-hand comparison array.
return array Returns an array of the differences of `$left` compared to `$right`.
    protected static function _diff($left, $right)
    {
        $result = array();
        foreach ($left as $key => $value) {
            if (!array_key_exists($key, $right) || $left[$key] !== $right[$key]) {
                $result[$key] = $value;
            }
        }
        return $result;
    }