latest update
[namibia] / module / User / src / User / Report / ProfileGrid.php
1 <?php
2 namespace User\Report;
3
4
5
6 /**
7  * User Report.
8  * @author andre.fourie
9  */
10 class ProfileGrid extends \Utility\Service\Report
11 {
12
13
14
15     /**
16      * @var string
17      */
18     protected $_title  = 'User Data Export';
19     /**
20      * @var string
21      */
22     protected $_subject = 'System users.';
23     /**
24      * @var string
25      */
26     protected $_description = 'Export of system users.';
27     /**
28      * @var array
29      */
30     protected $_notes = array(
31         'Confidential information, generated using Bid 4 Cars, for more information visit bid4cars.com.na'
32     );
33     /**
34      * @var array
35      */
36     protected $_headers = array(
37         'Group',
38         'Dealership',
39         'Name',
40         'Surname',
41         'Email',
42         'Mobile',
43         'User Type',
44         'Status',
45         'Region',
46         'Town',
47         'Address',
48         'Registered'
49     );
50     /**
51      * @var array
52      */
53     protected $_fields = array(
54         'companyGroup_name',
55         'company_name',
56         'profile_firstName',
57         'profile_familyName',
58         'profile_email',
59         'profile_mobile',
60         'permissions_name',
61         'profile_jobState',
62         'region_name',
63         'city_name',
64         'company_street',
65         'profile_created'
66     );
67     /**
68      * @var array
69      */
70     protected $_totals = array();
71     /**
72      * @var array
73      */
74     protected $_currencyFields = array();
75
76
77
78     /**
79      * Build the dataset, or not.
80      */
81     public function build()
82     {
83         #-> Data passed by DataBin Grid functionality.
84         $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat();
85         foreach ($this->_data as $rowId => $rowData)
86         {
87             $this->_data[$rowId]['profile_created'] = $rowData['profile_created']->format($dateTimeFormat);
88         }
89     }
90
91 }