Skip to content

Commit

Permalink
Add GroupTokens to replace WelcomeTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 15, 2022
1 parent 95182b3 commit aa0252b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions CRM/Core/GroupTokens.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

/**
* Class CRM_Core_GroupTokens
*
* Generate "member.*" tokens.
*/
class CRM_Core_GroupTokens extends CRM_Core_EntityTokens {

/**
* Get the entity name for api v4 calls.
*
* @return string
*/
protected function getApiEntityName(): string {
return 'Group';
}

/**
* List out the fields that are exposed.
*
* @return string[]
*/
protected function getExposedFields(): array {
return [
'id',
'name',
'title',
'frontend_title',
'frontend_description',
];
}

}

0 comments on commit aa0252b

Please sign in to comment.