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:c1087517beb5b266d4a1a0a1a342ced0)
13 * Database access object for the EntityRole entity.
15 class CRM_ACL_DAO_EntityRole
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.6';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_acl_entity_role';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)
48 * Table of the object joined to the ACL Role (Contact or Group)
55 * ID of the group/contact object being joined
62 * Is this property active?
71 public function __construct() {
72 $this->__table
= 'civicrm_acl_entity_role';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Entity Roles') : ts('Entity Role');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Entity Role'),
113 'description' => ts('Unique table ID'),
115 'where' => 'civicrm_acl_entity_role.id',
116 'table_name' => 'civicrm_acl_entity_role',
117 'entity' => 'EntityRole',
118 'bao' => 'CRM_ACL_BAO_EntityRole',
123 'name' => 'acl_role_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('ACL Role ID'),
126 'description' => ts('Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)'),
128 'where' => 'civicrm_acl_entity_role.acl_role_id',
129 'table_name' => 'civicrm_acl_entity_role',
130 'entity' => 'EntityRole',
131 'bao' => 'CRM_ACL_BAO_EntityRole',
136 'name' => 'entity_table',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Entity Table'),
139 'description' => ts('Table of the object joined to the ACL Role (Contact or Group)'),
142 'size' => CRM_Utils_Type
::BIG
,
143 'where' => 'civicrm_acl_entity_role.entity_table',
144 'table_name' => 'civicrm_acl_entity_role',
145 'entity' => 'EntityRole',
146 'bao' => 'CRM_ACL_BAO_EntityRole',
151 'name' => 'entity_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('ACL Entity ID'),
154 'description' => ts('ID of the group/contact object being joined'),
156 'where' => 'civicrm_acl_entity_role.entity_id',
157 'table_name' => 'civicrm_acl_entity_role',
158 'entity' => 'EntityRole',
159 'bao' => 'CRM_ACL_BAO_EntityRole',
164 'name' => 'is_active',
165 'type' => CRM_Utils_Type
::T_BOOLEAN
,
166 'title' => ts('ACL Entity Role is Active'),
167 'description' => ts('Is this property active?'),
168 'where' => 'civicrm_acl_entity_role.is_active',
169 'table_name' => 'civicrm_acl_entity_role',
170 'entity' => 'EntityRole',
171 'bao' => 'CRM_ACL_BAO_EntityRole',
176 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
178 return Civi
::$statics[__CLASS__
]['fields'];
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
185 * Array(string $name => string $uniqueName).
187 public static function &fieldKeys() {
188 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
189 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
191 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 public static function getTableName() {
200 return self
::$_tableName;
204 * Returns if this table needs to be logged
208 public function getLog() {
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_entity_role', $prefix, []);
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_entity_role', $prefix, []);
237 * Returns the list of indices
239 * @param bool $localize
243 public static function indices($localize = TRUE) {
246 'name' => 'index_role',
250 'localizable' => FALSE,
251 'sig' => 'civicrm_acl_entity_role::0::acl_role_id',
254 'name' => 'index_entity',
259 'localizable' => FALSE,
260 'sig' => 'civicrm_acl_entity_role::0::entity_table::entity_id',
263 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;