Skip to content

Commit 4ee762f

Browse files
committed
Unset all order related objects from data array for backwards compatibility
1 parent 4904ea6 commit 4ee762f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/MShop/Order/Item/Base.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ abstract class Base
163163
*/
164164
public function __construct( string $prefix, array $values = [] )
165165
{
166-
parent::__construct( $prefix, $values );
167-
168166
$this->customer = $values['.customer'] ?? null;
169167
$this->locale = $values['.locale'];
170168
$this->price = $values['.price'];
@@ -197,6 +195,11 @@ public function __construct( string $prefix, array $values = [] )
197195
foreach( $this->get( '.statuses', [] ) as $status ) {
198196
$this->statuses[$status->getType()][$status->getValue()] = $status;
199197
}
198+
199+
unset( $values['.customer'], $values['.locale'], $values['.price'], $values['.statuses'] );
200+
unset( $values['.products'], $values['.coupons'], $values['.addresses'], $values['.services'] );
201+
202+
parent::__construct( $prefix, $values );
200203
}
201204

202205

0 commit comments

Comments
 (0)