5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/ACL/ACLEntityRole.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:fe3bd0baaffcc93590b3285c6cf96fc1)
13 * Database access object for the ACLEntityRole entity.
15 class CRM_ACL_DAO_ACLEntityRole
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('ACLEntity Roles') : ts('ACLEntity 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' => 'ACLEntityRole',
118 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
127 'name' => 'acl_role_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('ACL Role ID'),
130 'description' => ts('Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)'),
132 'where' => 'civicrm_acl_entity_role.acl_role_id',
133 'table_name' => 'civicrm_acl_entity_role',
134 'entity' => 'ACLEntityRole',
135 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
137 'pseudoconstant' => [
138 'optionGroupName' => 'acl_role',
139 'optionEditPath' => 'civicrm/admin/options/acl_role',
144 'name' => 'entity_table',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Entity Table'),
147 'description' => ts('Table of the object joined to the ACL Role (Contact or Group)'),
150 'size' => CRM_Utils_Type
::BIG
,
151 'where' => 'civicrm_acl_entity_role.entity_table',
152 'table_name' => 'civicrm_acl_entity_role',
153 'entity' => 'ACLEntityRole',
154 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
156 'pseudoconstant' => [
157 'callback' => 'CRM_ACL_BAO_ACLEntityRole::entityTables',
162 'name' => 'entity_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('ACL Entity ID'),
165 'description' => ts('ID of the group/contact object being joined'),
167 'where' => 'civicrm_acl_entity_role.entity_id',
168 'table_name' => 'civicrm_acl_entity_role',
169 'entity' => 'ACLEntityRole',
170 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
175 'name' => 'is_active',
176 'type' => CRM_Utils_Type
::T_BOOLEAN
,
177 'title' => ts('ACL Entity Role is Active'),
178 'description' => ts('Is this property active?'),
179 'where' => 'civicrm_acl_entity_role.is_active',
180 'table_name' => 'civicrm_acl_entity_role',
181 'entity' => 'ACLEntityRole',
182 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
187 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
189 return Civi
::$statics[__CLASS__
]['fields'];
193 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 * Array(string $name => string $uniqueName).
198 public static function &fieldKeys() {
199 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
200 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
202 return Civi
::$statics[__CLASS__
]['fieldKeys'];
206 * Returns the names of this table
210 public static function getTableName() {
211 return self
::$_tableName;
215 * Returns if this table needs to be logged
219 public function getLog() {
224 * Returns the list of fields that can be imported
226 * @param bool $prefix
230 public static function &import($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_entity_role', $prefix, []);
236 * Returns the list of fields that can be exported
238 * @param bool $prefix
242 public static function &export($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_entity_role', $prefix, []);
248 * Returns the list of indices
250 * @param bool $localize
254 public static function indices($localize = TRUE) {
257 'name' => 'index_role',
261 'localizable' => FALSE,
262 'sig' => 'civicrm_acl_entity_role::0::acl_role_id',
265 'name' => 'index_entity',
270 'localizable' => FALSE,
271 'sig' => 'civicrm_acl_entity_role::0::entity_table::entity_id',
274 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;