1 | <?php |
||
7 | class LDAPGroupExtension extends DataExtension |
||
|
|||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private static $db = [ |
||
13 | // Unique user identifier, same field is used by SAMLMemberExtension |
||
14 | 'GUID' => 'Varchar(50)', |
||
15 | 'DN' => 'Text', |
||
16 | 'LastSynced' => 'SS_Datetime' |
||
17 | ]; |
||
18 | |||
19 | /** |
||
20 | * A SilverStripe group can have several mappings to LDAP groups. |
||
21 | * @var array |
||
22 | */ |
||
23 | private static $has_many = [ |
||
24 | 'LDAPGroupMappings' => 'LDAPGroupMapping' |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * Add a field to the Group_Members join table so we can keep track |
||
29 | * of Members added to a mapped Group. |
||
30 | * |
||
31 | * See {@link LDAPService::updateMemberFromLDAP()} for more details |
||
32 | * on how this gets used. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | private static $many_many_extraFields = [ |
||
37 | 'Members' => [ |
||
38 | 'IsImportedFromLDAP' => 'Boolean' |
||
39 | ] |
||
40 | ]; |
||
41 | |||
42 | public function updateCMSFields(FieldList $fields) |
||
90 | |||
91 | /** |
||
92 | * LDAPGroupMappings are inherently relying on groups and can be removed now. |
||
93 | */ |
||
94 | public function onBeforeDelete() |
||
100 | } |
||
101 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.