Closed stevepop closed 9 years ago
The IDE is right! I overlooked the fact that an object property can't be accessed inside another object property. This doesn't work:
$documentFields = [
'title' => $this->title // accessing another object property
];
I'll make 'documentFields' a method and update the documentation in a few minutes.
Hi Fadion,
Nice work. Glad I was able to spot that. That's to tell you I am actively using Bouncy for my projects :)
Thanks for the good work.
Regards,
Steve
On Tue, May 5, 2015 at 8:37 PM, Fadion Dashi notifications@github.com wrote:
The IDE is right! I overlooked the fact that an object property can't be accessed inside another object property. This doesn't work:
$documentFields = [ 'title' => $this->title // accessing another object property];
I'll make 'documentFields' a method and update the documentation in a few minutes.
— Reply to this email directly or view it on GitHub https://github.com/fadion/Bouncy/issues/7#issuecomment-99198588.
Steve O. Popoola Email: stevepop@gmail.com LinkedIn: http://uk.linkedin.com/in/stevepop Twitter ID: http://www.twitter.com/stpopoola
I'm glad to hear that. Feel free to suggest any enhancement or feature.
Hi, I tried creating the $documentFields property in my model but was getting an error in my IDE, "expression is not allowed as field default value". I even copied the array in the documentation thinking that I probably have a typo somewhere but got the same error.
I needed to do this as I need to have a custom field for "full_name" which is a concatenation of first_name and last_name but I don't want to have to create this in my database.
Can you reproduce this error? what seems to be the issue?
Thanks.