-
Notifications
You must be signed in to change notification settings - Fork 348
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
Revisionable and Mutators #21
Comments
This would be because the raw data is what is stored in the revisions table, hence the data that is output is simply
I'll have a look and see if there's a way to make it smarter, and output using the mutator if available |
According to the eloquent docs Accessors are named like this: getFieldnameAttribute You check for method getFieldname atm, so this can't work for me :) |
Oops... sorry. Fixed up, try that. |
And now also in line 140 - thats the problem with redundant code, as always ;) |
true |
Now the accessor is used. Good! But the main model attributes are not there:
Undefined index: price |
Where are you calling the set method from? On Wed, Aug 7, 2013 at 10:36 PM, mmodler notifications@github.com wrote:
|
It happens in my Revision detail controller with $revision = Revision::find(Input::get('revision_id', null)) |
Not sure why that would call the set mutator. Don't suppose you have a full stack trace? On Wed, Aug 7, 2013 at 10:42 PM, mmodler notifications@github.com wrote:
|
It really should! If i load a single revision i also want to have nice "mutated" data. Stack trace: ErrorException |
Stop thinking! ;) It was my fault. With accessors i should use getFieldnameAttribute($value) and work with $value, not with $this... |
What is the line of code that is causing the problem? Revisionable doesn't call any Your stack trace looks like it's calling the getPriceAttribute accessor, but there's no reference to the setPriceAttribute being called... or am I missing something? |
Ahhh, awesome. All sorted then. |
Hi,
one of my revisionable models has some mutators like getPriceAttribute / setPriceAttribute.
Revisionable's oldValue / newValue irgnores my getter and returns the raw price atrribute?
The text was updated successfully, but these errors were encountered: