KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I created a module and want to used core write and read function to insert,update,delete or select database value with condition, how can I do it without using SQL? Example: $customer_id=123 Model=(referral/referral) SELECT $collection3 = Mage::getModel('referral/referral')->getCollection(); $collection3->addFieldToFilter('customer_id', array('eq' => $customer_id)); foreach($collection3 as $data1) { $ref_cust_id.= $data1->getData('referral_customer_id'); } INSERT $collection1= Mage::getModel('referral/referral'); $collection1->setData('customer_id',$customer_id)->save(); DELETE,UPDATE(with condition)=???
Tags (comma-separated)
Save Edits
Cancel