mysql - magento enterprise_targetrule/index model not saving -
i executing code:
$model1 = mage::getmodel('enterprise_targetrule/index')->load(5511); var_dump($model1); $model2 = mage::getmodel('enterprise_targetrule/index')-> load(5511)-> setflag('0')-> save(); var_dump($model2); $model3 = mage::getmodel('enterprise_targetrule/index')->load(5511); var_dump($model3); die();
the outputs var_dump calls expect: $_data[flag]
1 $model1
, 0 $model2
, $model3
, , $_origdata[flag]
1 $model1
, $model2
, , 0 $model3.
so far, looking right. however, when (immediately after running code), execute select * enterprise_targetrule_index
on database, result:
mysql> select * enterprise_targetrule_index; +-----------+----------+-------------------+---------+------+ | entity_id | store_id | customer_group_id | type_id | flag | +-----------+----------+-------------------+---------+------+ | 5511 | 7 | 0 | 1 | 1 |
why?
why flag not getting updated? models correct, fields correct, save , load calls succeed , return perfect results, database not updated! it's change save() doesn't written, , yet can somehow still loaded, @ least within script. going on here? special model, makes unable save?
$model2 = mage::getmodel('enterprise_targetrule/index')->load(5511);
$model2->setflag('0');
$model2->save();
echo $model2->getflag();
if use var_dump displays whole object..