-
Notifications
You must be signed in to change notification settings - Fork 19
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
Expose eg found_posts to QueryBuilder from PostQuery ? #42
Comments
this seems to work in the meantime $query = (new QueryBuilder)->wherePostType(["news","event"])->limit(3)->as(SocialPost::class);
// or $query = SocialPost::builder()->limit(3);
$post_query = new PostQuery($query->getParameters(), SocialPost::class);
$posts = $post_query->get_posts();
dd(count($posts)." of ".$post_query->found_posts); shows: 3 out of 10 is there anything that $posts = collect($post_query->get_posts()); thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
would it be possible to expose the
PostQuery
to theQueryBuilder
etc so we can get eg->found_posts
(and any similar data)currently I have to run a separate
WP_Query
with my builder's$query->getParameters()
just to get the info again but this means querying all the posts that presumably have already been queriedI'm not sure what the syntax for it would be though. I did see it is possible to add elements to the collection outside of the items array,. so maybe accessible that way?
currently I tack it on to the end of my collection from that
WP_Query
then call egthanks for any suggestions.
J
The text was updated successfully, but these errors were encountered: