Extends
lithium\core\Object
Overwrites session keys and values.
Parameters
- array $old Reference to the array that needs to be overwritten. Will usually be `$_SESSION`.
- array $new The data that should overwrite the keys/values in `$old`.
Returns
boolean Always `true`Source
public static function overwrite(&$old, $new) {
if (!empty($old)) {
foreach ($old as $key => $value) {
if (!isset($new[$key])) {
unset($old[$key]);
}
}
}
foreach ($new as $key => $value) {
$old[$key] = $value;
}
return true;
}