public function __construct($data = null) { if ($data) { if (!array_key_exists('alias', $data['address'])) { $data['address'] = current($data['address']); } foreach ($this->conversion() as $old => $new) { if (array_key_exists($old, $data)) { $data[$new] = $data[$old]; unset($data[$old]); } } } parent::__construct($data); }
public function getSchema() { return array_merge(parent::getSchema(), ['customerIdentity' => 'string', 'billingAddress' => 'object', 'shippingAddress' => 'object']); }