5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/ACL/EntityRole.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0dc853871318ba5645e0f8f12aac58f6)
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 foreign keys and entity references.
78 * [CRM_Core_Reference_Interface]
80 public static function getReferenceColumns() {
81 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
82 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
84 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
86 return Civi
::$statics[__CLASS__
]['links'];
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('Entity Role'),
101 'description' => ts('Unique table ID'),
103 'where' => 'civicrm_acl_entity_role.id',
104 'table_name' => 'civicrm_acl_entity_role',
105 'entity' => 'EntityRole',
106 'bao' => 'CRM_ACL_BAO_EntityRole',
110 'name' => 'acl_role_id',
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('ACL Role ID'),
113 'description' => ts('Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)'),
115 'where' => 'civicrm_acl_entity_role.acl_role_id',
116 'table_name' => 'civicrm_acl_entity_role',
117 'entity' => 'EntityRole',
118 'bao' => 'CRM_ACL_BAO_EntityRole',
122 'name' => 'entity_table',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Entity Table'),
125 'description' => ts('Table of the object joined to the ACL Role (Contact or Group)'),
128 'size' => CRM_Utils_Type
::BIG
,
129 'where' => 'civicrm_acl_entity_role.entity_table',
130 'table_name' => 'civicrm_acl_entity_role',
131 'entity' => 'EntityRole',
132 'bao' => 'CRM_ACL_BAO_EntityRole',
136 'name' => 'entity_id',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('ACL Entity ID'),
139 'description' => ts('ID of the group/contact object being joined'),
141 'where' => 'civicrm_acl_entity_role.entity_id',
142 'table_name' => 'civicrm_acl_entity_role',
143 'entity' => 'EntityRole',
144 'bao' => 'CRM_ACL_BAO_EntityRole',
148 'name' => 'is_active',
149 'type' => CRM_Utils_Type
::T_BOOLEAN
,
150 'title' => ts('ACL Entity Role is Active'),
151 'description' => ts('Is this property active?'),
152 'where' => 'civicrm_acl_entity_role.is_active',
153 'table_name' => 'civicrm_acl_entity_role',
154 'entity' => 'EntityRole',
155 'bao' => 'CRM_ACL_BAO_EntityRole',
159 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
161 return Civi
::$statics[__CLASS__
]['fields'];
165 * Return a mapping from field-name to the corresponding key (as used in fields()).
168 * Array(string $name => string $uniqueName).
170 public static function &fieldKeys() {
171 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
172 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
174 return Civi
::$statics[__CLASS__
]['fieldKeys'];
178 * Returns the names of this table
182 public static function getTableName() {
183 return self
::$_tableName;
187 * Returns if this table needs to be logged
191 public function getLog() {
196 * Returns the list of fields that can be imported
198 * @param bool $prefix
202 public static function &import($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_entity_role', $prefix, []);
208 * Returns the list of fields that can be exported
210 * @param bool $prefix
214 public static function &export($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_entity_role', $prefix, []);
220 * Returns the list of indices
222 * @param bool $localize
226 public static function indices($localize = TRUE) {
229 'name' => 'index_role',
233 'localizable' => FALSE,
234 'sig' => 'civicrm_acl_entity_role::0::acl_role_id',
237 'name' => 'index_entity',
242 'localizable' => FALSE,
243 'sig' => 'civicrm_acl_entity_role::0::entity_table::entity_id',
246 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;