I need to update particular field in table using CRUD operation of Magento.
I have tried below for insert new record it is working
$this->_cancelFactory->create()->setData(array('cancel_status'=>'Review'))->save();
I have tried below for update particular row but it does not work
$this->_cancelFactory->create()->setData(array('cancel_status'=>'Canceled'))->where(array('order_id'=>$oid))->save();
What is the right way to update table?
Best Answer
But as explained in the answers in here: Deprecated save and load methods in Abstract Model,
load
andsave
are deprecated. You should create service contracts for your module.