-
Notifications
You must be signed in to change notification settings - Fork 47
Aggregation and Reports
Romans Malinovskis edited this page Apr 18, 2016
·
1 revision
Ability to create reports is probably one of the most complex areas where many data access libraries fall short and prove to be absolutely useless to do anything else other than execute a stored procedure.
The problem we solve with Reports is that we allow you to create your report directly from your Business Models. We already know how to convert them into queries and we are pretty good at manipulating queries so let's see what we can do:
$client_aggregate = $client->aggregate();
$client_aggregate->groupBy('age');
$client_aggregate->addSum('completed_orders,total_orders');
$client_aggregate->addFx('avg','amm',$client->getElement('amount'));
// example of manual function definition
$all_users = $db->add(new atk4\data\Union());
$all_users->addModel('Client');
$all_users->addModel('Admin');
Agile Data, Documentation and Wiki content is licensed under MIT and (c) by Agile Toolkit Limited UK