Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a call to save to a storage on item update() #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alexrayan
Copy link

Neither Cart::update($id, 'price', $price); nor Cart::item($id)->update('price',$price); triggers saving to a storage, therefore on next Cart construction the updates are lost.

I initially wanted to add another method to a storage save() which would call saveCart() protected method since with the above approach the following won't trigger update:

Cart::item($id)->price = $price;

But adding a $this->store->insertUpdate($this) within an Item object is better, since attribute value reassignment doesn't really tell us that the item has been updated and saved.

Regards,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant