5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/ACL/EntityRole.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2e8133b4c385feaa934b2d14ea40f971)
13 * Database access object for the EntityRole entity.
15 class CRM_ACL_DAO_EntityRole
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_acl_entity_role';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)
46 * Table of the object joined to the ACL Role (Contact or Group)
53 * ID of the group/contact object being joined
60 * Is this property active?
69 public function __construct() {
70 $this->__table
= 'civicrm_acl_entity_role';
71 parent
::__construct();
75 * Returns localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Entity Roles');
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
91 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
93 return Civi
::$statics[__CLASS__
]['links'];
97 * Returns all the column names of this table
101 public static function &fields() {
102 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
103 Civi
::$statics[__CLASS__
]['fields'] = [
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Entity Role'),
108 'description' => ts('Unique table ID'),
110 'where' => 'civicrm_acl_entity_role.id',
111 'table_name' => 'civicrm_acl_entity_role',
112 'entity' => 'EntityRole',
113 'bao' => 'CRM_ACL_BAO_EntityRole',
118 'name' => 'acl_role_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('ACL Role ID'),
121 'description' => ts('Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)'),
123 'where' => 'civicrm_acl_entity_role.acl_role_id',
124 'table_name' => 'civicrm_acl_entity_role',
125 'entity' => 'EntityRole',
126 'bao' => 'CRM_ACL_BAO_EntityRole',
131 'name' => 'entity_table',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Entity Table'),
134 'description' => ts('Table of the object joined to the ACL Role (Contact or Group)'),
137 'size' => CRM_Utils_Type
::BIG
,
138 'where' => 'civicrm_acl_entity_role.entity_table',
139 'table_name' => 'civicrm_acl_entity_role',
140 'entity' => 'EntityRole',
141 'bao' => 'CRM_ACL_BAO_EntityRole',
146 'name' => 'entity_id',
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('ACL Entity ID'),
149 'description' => ts('ID of the group/contact object being joined'),
151 'where' => 'civicrm_acl_entity_role.entity_id',
152 'table_name' => 'civicrm_acl_entity_role',
153 'entity' => 'EntityRole',
154 'bao' => 'CRM_ACL_BAO_EntityRole',
159 'name' => 'is_active',
160 'type' => CRM_Utils_Type
::T_BOOLEAN
,
161 'title' => ts('ACL Entity Role is Active'),
162 'description' => ts('Is this property active?'),
163 'where' => 'civicrm_acl_entity_role.is_active',
164 'table_name' => 'civicrm_acl_entity_role',
165 'entity' => 'EntityRole',
166 'bao' => 'CRM_ACL_BAO_EntityRole',
171 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
173 return Civi
::$statics[__CLASS__
]['fields'];
177 * Return a mapping from field-name to the corresponding key (as used in fields()).
180 * Array(string $name => string $uniqueName).
182 public static function &fieldKeys() {
183 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
184 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
186 return Civi
::$statics[__CLASS__
]['fieldKeys'];
190 * Returns the names of this table
194 public static function getTableName() {
195 return self
::$_tableName;
199 * Returns if this table needs to be logged
203 public function getLog() {
208 * Returns the list of fields that can be imported
210 * @param bool $prefix
214 public static function &import($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_entity_role', $prefix, []);
220 * Returns the list of fields that can be exported
222 * @param bool $prefix
226 public static function &export($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_entity_role', $prefix, []);
232 * Returns the list of indices
234 * @param bool $localize
238 public static function indices($localize = TRUE) {
241 'name' => 'index_role',
245 'localizable' => FALSE,
246 'sig' => 'civicrm_acl_entity_role::0::acl_role_id',
249 'name' => 'index_entity',
254 'localizable' => FALSE,
255 'sig' => 'civicrm_acl_entity_role::0::entity_table::entity_id',
258 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;