1 | <?php |
||
13 | class MemberReportExtension extends DataExtension |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Connect the link to LoginAttempt. |
||
18 | * This relationship is always defined (whether enabled or not), |
||
19 | * although only normally accessible from the `LoginAttempt` side. |
||
20 | * This is adding the reflection, as that it is also accessible |
||
21 | * from the `Member` side. |
||
22 | * |
||
23 | * @var array |
||
24 | * @config |
||
25 | */ |
||
26 | private static $has_many = [ |
||
|
|||
27 | 'LoginAttempts' => LoginAttempt::class |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Set cast of additional fields |
||
32 | * |
||
33 | * @var array |
||
34 | * @config |
||
35 | */ |
||
36 | private static $casting = array( |
||
37 | 'GroupsDescription' => 'Text', |
||
38 | 'PermissionsDescription' => 'Text' |
||
39 | ); |
||
40 | |||
41 | /** |
||
42 | * Retrieves the most recent successful LoginAttempt |
||
43 | * |
||
44 | * @return DBDatetime|string |
||
45 | */ |
||
46 | public function getLastLoggedIn() |
||
55 | |||
56 | /** |
||
57 | * Builds a comma separated list of member group names for a given Member. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getGroupsDescription() |
||
87 | |||
88 | /** |
||
89 | * Builds a comma separated list of human-readbale permissions for a given Member. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getPermissionsDescription() |
||
125 | } |
||
126 |
This check marks private properties in classes that are never used. Those properties can be removed.