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