3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Access Control AclRole.
21 class CRM_ACL_BAO_ACLEntityRole
extends CRM_ACL_DAO_ACLEntityRole
{
24 * Whitelist of possible values for the entity_table field
28 public static function entityTables(): array {
30 'civicrm_contact' => ts('Contact'),
31 'civicrm_group' => ts('Group'),
36 * @param array $params
38 * @return CRM_ACL_DAO_EntityRole
40 public static function create(&$params) {
41 return self
::writeRecord($params);
45 * @param array $params
48 public static function retrieve(&$params, &$defaults) {
49 CRM_Core_DAO
::commonRetrieve(__CLASS__
, $params, $defaults);
53 * Update the is_active flag in the db.
56 * Id of the database record.
57 * @param bool $is_active
58 * Value we want to set the is_active field.
61 * true if we found and updated the object, else false
63 public static function setIsActive($id, $is_active) {
64 return CRM_Core_DAO
::setFieldValue(__CLASS__
, $id, 'is_active', $is_active);
68 * Delete Dedupe Entity Role records.
70 * @param int $entityRoleId
71 * ID of the EntityRole record to be deleted.
74 public static function del($entityRoleId) {
75 return self
::deleteRecord(['id' => $entityRoleId]);