public function create(array
$params) { $this->
checkPrivilege('create'
);
$this->
setupContext($params['shopId'
] ?? null
);
// Create models
$customer =
new CustomerModel();
$customer->
setAttribute(new CustomerAttribute());
// Normalize call between create and update to allow same parameters
if (isset($params['defaultBillingAddress'
])) { $params['billing'
] =
$params['defaultBillingAddress'
];
unset($params['defaultBillingAddress'
]);
} if (isset($params['defaultShippingAddress'
])) { $params['shipping'
] =
$params['defaultShippingAddress'
];
unset($params['defaultShippingAddress'
]);
}