Remove unused functions
[civicrm-core.git] / CRM / ACL / BAO / ACLEntityRole.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Access Control AclRole.
20 */
21 class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
22
23 /**
24 * Whitelist of possible values for the entity_table field
25 *
26 * @return array
27 */
28 public static function entityTables(): array {
29 return [
30 'civicrm_contact' => ts('Contact'),
31 'civicrm_group' => ts('Group'),
32 ];
33 }
34
35 /**
36 * @param array $params
37 *
38 * @return CRM_ACL_BAO_ACLEntityRole
39 */
40 public static function create(&$params) {
41 return self::writeRecord($params);
42 }
43
44 /**
45 * Retrieve DB object and copy to defaults array.
46 *
47 * @param array $params
48 * Array of criteria values.
49 * @param array $defaults
50 * Array to be populated with found values.
51 *
52 * @return self|null
53 * The DAO object, if found.
54 *
55 * @deprecated
56 */
57 public static function retrieve($params, &$defaults) {
58 return self::commonRetrieve(self::class, $params, $defaults);
59 }
60
61 /**
62 * Update the is_active flag in the db.
63 *
64 * @param int $id
65 * Id of the database record.
66 * @param bool $is_active
67 * Value we want to set the is_active field.
68 *
69 * @return bool
70 * true if we found and updated the object, else false
71 */
72 public static function setIsActive($id, $is_active) {
73 return CRM_Core_DAO::setFieldValue(__CLASS__, $id, 'is_active', $is_active);
74 }
75
76 /**
77 * Delete Dedupe Entity Role records.
78 *
79 * @param int $entityRoleId
80 * ID of the EntityRole record to be deleted.
81 * @deprecated
82 */
83 public static function del($entityRoleId) {
84 return self::deleteRecord(['id' => $entityRoleId]);
85 }
86
87 }