...
groupableAttributes()
defines the set of attributes the Plugin knows about that may be used for generating group memberships. This may be a static list of attributes, or (as of v3.1.0) it may be dynamically determined based on a given instantiation (via the configuration available in$this->pluginCfg
).resultToGroups()
converts a raw result into an array of attribute value/pairs. Note the array is not itself the group mapping, but rather the relevant attributes that will be used by the core code to determine if any group membership match. (This way the Plugin does not need to worry about parsing the mapping configuration.)
...
Info |
---|
Prior to v3.2.0, the Note that while it is possible for a backend to return multiple entries for the same group with different validity dates, these must be consolidated down to a single CoGroupMember record. (While the data format theoretically allows multiple CoGroupMember records for the same CO Person in the same CO Group with different validity windows, in practice this is not supported anywhere.) If multiple entries are found, the group membership mapping code will attempt to pick the "best" one, which is generally the current record, or the one with the latest valid through date. Plugins can implement more deterministic algorithms by setting the results from |
Example
Code Block | ||
---|---|---|
| ||
public function groupableAttributes() { return array( 'title' => _txt('fd.title'); ); } public function resultToGroups($raw) { // The core code will use this data to determine if the configured // OIS Group Mapping rules are matched. return array( 'title' => array( array( 'value' => 'Professor of Mysterious Events', 'valid_from' => '2017-08-01 00:00:00', 'valid_through' => '2018-07-31 23:59:59' ); ); ); } |
...