ty0716 Posted July 21, 2015 Report Posted July 21, 2015 I want to get all services list in once sql query. and i see the docs in http://source-docs.blesta.com/class-Services.html getList( integer $client_id = null, string $status = "active", integer $page = 1, array $order_by = array('date_added'=>"DESC"), boolean $children = true ) whether this only can query a status in a function use? $status = "active". Quote
0 Blesta Addons Posted July 21, 2015 Report Posted July 21, 2015 this can do the trick . $status = "all" Quote
0 Tyson Posted July 21, 2015 Report Posted July 21, 2015 Services::getList is paginated, so you will only receive a max of 20 results by default. Also, additional queries are made automatically for more service information (e.g. package pricing) for each service found. If that's fine for you, then set the status to "all" as naja7host suggested. There is no direct method to fetch every service in a single query. If you really need all services in one method call, you might try Services::getAllChildren by passing in a null $parent_service_id. But of course, that would retrieve all parent services and no addon services. It would also be slow for large numbers of services. Quote
0 Blesta Addons Posted July 23, 2015 Report Posted July 23, 2015 Services::getList is paginated, so you will only receive a max of 20 results by default. Also, additional queries are made automatically for more service information (e.g. package pricing) for each service found. If that's fine for you, then set the status to "all" as naja7host suggested. There is no direct method to fetch every service in a single query. If you really need all services in one method call, you might try Services::getAllChildren by passing in a null $parent_service_id. But of course, that would retrieve all parent services and no addon services. It would also be slow for large numbers of services. getAllChildren() not for all services without client_id filtered . the getServices() is the best fucntion , but is pain that is a private . i suggest to return it as public , because it will help in more cases . and the other public function are limited in result (20 max) . Quote
0 Tyson Posted July 24, 2015 Report Posted July 24, 2015 Services::getServices is a helper method for creating a Record object. We wouldn't want such a method to be public. Quote
Question
ty0716
I want to get all services list in once sql query.
and i see the docs in http://source-docs.blesta.com/class-Services.html
getList( integer $client_id = null, string $status = "active", integer $page = 1, array $order_by = array('date_added'=>"DESC"), boolean $children = true )
whether this only can query a status in a function use? $status = "active".
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.