ray*_*phi 13 php magento magento-1.7
是否有可能通过我模型的另一个领域记录我的模型?
正常的方式
$model = Mage::getModel('foo_bar/baz');
$model->load($id);
// do something with the loaded record
Run Code Online (Sandbox Code Playgroud)
但我需要这样的东西
$model = Mage::getModel('foo_bar/baz');
$model->loadByAnotherFieldOfModel($value)
// do something with the loaded record
Run Code Online (Sandbox Code Playgroud)
那可能吗?
OSd*_*ave 53
$model = Mage::getModel('foo_bar/baz');
$model->load('field_value', 'field_name');
Run Code Online (Sandbox Code Playgroud)