Is save() method deprecated and what would I use instead?

Hi /r/magento

In my Observer I’m getting customer like

$customer = $observer->getEvent()->getCustomer(); 

from event

<event name="customer_save_after"> 

Anyway, later on, I’m using it to save a custom customer attribute like

$customerData = $customer->getDataModel(); $customerData->setCustomAttribute('customer_number', $customerNumber); $customer->updateData($customerData); $customer->save(); 

This works fine but I read that save() method is deprecated.

Is that correct and if so, what method would I use instead?

Thank you

submitted by /u/zlep
[link] [comments]