How create custom magento object? I climbed the entire Internet and can not find the answer I want to stick my data into it


Magento 1 :

$object = new Varien_Object();

Magento 2 :

$object = new \Magento\Framework\DataObject();
  • I used this code $object = new Varien_Object(); but how to cram data inside? – Denis Maksiura Oct 8 at 15:13
  • Try : $object->setData($yourData); – PЯINCƏ Oct 8 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.