62 list($from, $get) = $from;
64 $fromIsArray = is_array($from);
65 $fromIsVO = $from instanceof \Magento\Framework\DataObject;
82 list($to, $set) = $to;
84 $toIsArray = is_array($to);
85 $toIsVO = $to instanceof \Magento\Framework\DataObject;
87 foreach (
$map as $keyFrom => $keyTo) {
88 if (!is_string($keyFrom)) {
92 if (array_key_exists($keyFrom, $from)) {
94 $to[$keyTo] = $from[$keyFrom];
96 $to->{$set}($keyTo, $from[$keyFrom]);
102 if ($shouldGet = $from->hasData($keyFrom)) {
103 $value = $from->{$get}($keyFrom);
104 }
elseif (method_exists($from, $get)) {
105 $value = $from->{$get}($keyFrom);
114 $to->{$set}($keyTo,
$value);
119 foreach ($defaults as $keyTo =>
$value) {
121 if (!isset($to[$keyTo])) {
125 if (!$to->hasData($keyTo)) {
126 $to->{$set}($keyTo,
$value);
elseif(isset( $params[ 'redirect_parent']))
static & accumulateByMap($from, $to, array $map, array $defaults=[])