We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I needed more than one condition in getAllBy method and I made changes like this:
getAllBy
public function getAllBy(array $conditions = array(), array $with = array('translations'), $all = false) { $query = $this->make($with); if (! $all) { // Take only online and translated items $query = $query->whereHasOnlineTranslation(); } if(is_array($conditions) && count($conditions)) { foreach($conditions as $key => $value) { $query->where($key, $value); } } $models = $query->get(); return $models; }
And then in any Controller:
$conditions = array( 'category_id' => $category->id, 'type' => $type ); $data = $this->repository->getAllBy($conditions, $relatedModels, false);
What do you think about this?
The text was updated successfully, but these errors were encountered:
Fine, but don't forget to update interface and cache decorator + docblocks.
Sorry, something went wrong.
No branches or pull requests
I needed more than one condition in
getAllBy
method and I made changes like this:And then in any Controller:
What do you think about this?
The text was updated successfully, but these errors were encountered: