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:b7a657943e1cf6e84d93e4b729fe7d10)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
52 * Table of the object joined to the ACL Role (Contact or Group)
55 * (SQL type: varchar(64))
56 * Note that values will be retrieved from the database as a string.
61 * ID of the group/contact object being joined
64 * (SQL type: int unsigned)
65 * Note that values will be retrieved from the database as a string.
70 * Is this property active?
74 * Note that values will be retrieved from the database as a string.
81 public function __construct() {
82 $this->__table
= 'civicrm_acl_entity_role';
83 parent
::__construct();
87 * Returns localized title of this entity.
90 * Whether to return the plural version of the title.
92 public static function getEntityTitle($plural = FALSE) {
93 return $plural ?
ts('ACLEntity Roles') : ts('ACLEntity Role');
97 * Returns foreign keys and entity references.
100 * [CRM_Core_Reference_Interface]
102 public static function getReferenceColumns() {
103 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
104 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
106 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
108 return Civi
::$statics[__CLASS__
]['links'];
112 * Returns all the column names of this table
116 public static function &fields() {
117 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
118 Civi
::$statics[__CLASS__
]['fields'] = [
121 'type' => CRM_Utils_Type
::T_INT
,
122 'title' => ts('Entity Role'),
123 'description' => ts('Unique table ID'),
125 'where' => 'civicrm_acl_entity_role.id',
126 'table_name' => 'civicrm_acl_entity_role',
127 'entity' => 'ACLEntityRole',
128 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
137 'name' => 'acl_role_id',
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('ACL Role ID'),
140 'description' => ts('Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)'),
142 'where' => 'civicrm_acl_entity_role.acl_role_id',
143 'table_name' => 'civicrm_acl_entity_role',
144 'entity' => 'ACLEntityRole',
145 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
147 'pseudoconstant' => [
148 'optionGroupName' => 'acl_role',
149 'optionEditPath' => 'civicrm/admin/options/acl_role',
154 'name' => 'entity_table',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Entity Table'),
157 'description' => ts('Table of the object joined to the ACL Role (Contact or Group)'),
160 'size' => CRM_Utils_Type
::BIG
,
161 'where' => 'civicrm_acl_entity_role.entity_table',
162 'table_name' => 'civicrm_acl_entity_role',
163 'entity' => 'ACLEntityRole',
164 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
166 'pseudoconstant' => [
167 'callback' => 'CRM_ACL_BAO_ACLEntityRole::entityTables',
172 'name' => 'entity_id',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('ACL Entity ID'),
175 'description' => ts('ID of the group/contact object being joined'),
177 'where' => 'civicrm_acl_entity_role.entity_id',
178 'table_name' => 'civicrm_acl_entity_role',
179 'entity' => 'ACLEntityRole',
180 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
185 'name' => 'is_active',
186 'type' => CRM_Utils_Type
::T_BOOLEAN
,
187 'title' => ts('ACL Entity Role is Active'),
188 'description' => ts('Is this property active?'),
190 'where' => 'civicrm_acl_entity_role.is_active',
192 'table_name' => 'civicrm_acl_entity_role',
193 'entity' => 'ACLEntityRole',
194 'bao' => 'CRM_ACL_BAO_ACLEntityRole',
199 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
201 return Civi
::$statics[__CLASS__
]['fields'];
205 * Return a mapping from field-name to the corresponding key (as used in fields()).
208 * Array(string $name => string $uniqueName).
210 public static function &fieldKeys() {
211 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
212 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
214 return Civi
::$statics[__CLASS__
]['fieldKeys'];
218 * Returns the names of this table
222 public static function getTableName() {
223 return self
::$_tableName;
227 * Returns if this table needs to be logged
231 public function getLog() {
236 * Returns the list of fields that can be imported
238 * @param bool $prefix
242 public static function &import($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_entity_role', $prefix, []);
248 * Returns the list of fields that can be exported
250 * @param bool $prefix
254 public static function &export($prefix = FALSE) {
255 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_entity_role', $prefix, []);
260 * Returns the list of indices
262 * @param bool $localize
266 public static function indices($localize = TRUE) {
269 'name' => 'index_role',
273 'localizable' => FALSE,
274 'sig' => 'civicrm_acl_entity_role::0::acl_role_id',
277 'name' => 'index_entity',
282 'localizable' => FALSE,
283 'sig' => 'civicrm_acl_entity_role::0::entity_table::entity_id',
286 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;