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

Parse doesnthave() condition and add to cache key #23

Closed
brunorsantos opened this issue Oct 14, 2017 · 1 comment
Closed

Parse doesnthave() condition and add to cache key #23

brunorsantos opened this issue Oct 14, 2017 · 1 comment
Assignees

Comments

@brunorsantos
Copy link
Contributor

Issue

It has to be created cache for when tried to retrieve from a model, some result that we doesn't want a relationship attached.

For example: Authors that does not have books:
$authors = collect([(new Author)->doesntHave('books')->first()]);

Stack Trace

Currently, if we try to execute the method, we have this stack:

ErrorException: Undefined index: column

/home/vagrant/Code/laravel-model-caching/src/CachedBuilder.php:106
/home/vagrant/Code/laravel-model-caching/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1197
/home/vagrant/Code/laravel-model-caching/src/CachedBuilder.php:107
/home/vagrant/Code/laravel-model-caching/src/CachedBuilder.php:28
/home/vagrant/Code/laravel-model-caching/src/CachedBuilder.php:203

@mikebronner
Copy link
Owner

Thanks for reporting the error. Caching should work with first(), looks like a bug crept in. Also, I don't think we are looking at the doesntHave() command when caching things, so that will need to be added.

@mikebronner mikebronner changed the title Implement caching for Relationship Absence Parse doesnhave() condition and add to cache key Oct 16, 2017
@mikebronner mikebronner changed the title Parse doesnhave() condition and add to cache key Parse doesnthave() condition and add to cache key Oct 16, 2017
@mikebronner mikebronner self-assigned this Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants