You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Get the reference even if it was deleted * @return Jam_Model */publicfunctionget_reference_paranoid()
{
Jam_Behavior_Paranoid::filter(Jam_Behavior_Paranoid::ALL);
$reference = $this->get_insist('reference');
Jam_Behavior_Paranoid::filter(Jam_Behavior_Paranoid::NORMAL);
return$reference;
}
If you are using Jam_Behavior_Paranoid::filter() in an outside scope using Model_Purchase_Item::price() or Model_Purchase_Item::compute_price() it would not work as expected.
Model_Purchase_Item::get_reference_paranoid()
looks like this:If you are using
Jam_Behavior_Paranoid::filter()
in an outside scope usingModel_Purchase_Item::price()
orModel_Purchase_Item::compute_price()
it would not work as expected.Imagine the following scenario:
The
price()
call would actually set the paranoid filter back to normal even on the first iteration.get_reference_paranoid()
should use the old-schooldeleted()
builder method.The text was updated successfully, but these errors were encountered: