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_BAO_ACLEntityRole
40 public static function create(&$params) {
41 return self
::writeRecord($params);
45 * Retrieve DB object and copy to defaults array.
47 * @param array $params
48 * Array of criteria values.
49 * @param array $defaults
50 * Array to be populated with found values.
53 * The DAO object, if found.
57 public static function retrieve($params, &$defaults) {
58 return self
::commonRetrieve(self
::class, $params, $defaults);
62 * Update the is_active flag in the db.
65 * Id of the database record.
66 * @param bool $is_active
67 * Value we want to set the is_active field.
70 * true if we found and updated the object, else false
72 public static function setIsActive($id, $is_active) {
73 return CRM_Core_DAO
::setFieldValue(__CLASS__
, $id, 'is_active', $is_active);
77 * Delete Dedupe Entity Role records.
79 * @param int $entityRoleId
80 * ID of the EntityRole record to be deleted.
83 public static function del($entityRoleId) {
84 return self
::deleteRecord(['id' => $entityRoleId]);