Regenerate DAO files
[civicrm-core.git] / CRM / Contact / DAO / GroupNesting.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Contact/GroupNesting.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0ca7da77b0229b439c9c3a4c4c2e4326)
10 */
11
12 /**
13 * Database access object for the GroupNesting entity.
14 */
15 class CRM_Contact_DAO_GroupNesting extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.0';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_group_nesting';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = TRUE;
32
33 /**
34 * Relationship ID
35 *
36 * @var int
37 */
38 public $id;
39
40 /**
41 * ID of the child group
42 *
43 * @var int
44 */
45 public $child_group_id;
46
47 /**
48 * ID of the parent group
49 *
50 * @var int
51 */
52 public $parent_group_id;
53
54 /**
55 * Class constructor.
56 */
57 public function __construct() {
58 $this->__table = 'civicrm_group_nesting';
59 parent::__construct();
60 }
61
62 /**
63 * Returns localized title of this entity.
64 */
65 public static function getEntityTitle() {
66 return ts('Group Nestings');
67 }
68
69 /**
70 * Returns foreign keys and entity references.
71 *
72 * @return array
73 * [CRM_Core_Reference_Interface]
74 */
75 public static function getReferenceColumns() {
76 if (!isset(Civi::$statics[__CLASS__]['links'])) {
77 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
78 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'child_group_id', 'civicrm_group', 'id');
79 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'parent_group_id', 'civicrm_group', 'id');
80 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
81 }
82 return Civi::$statics[__CLASS__]['links'];
83 }
84
85 /**
86 * Returns all the column names of this table
87 *
88 * @return array
89 */
90 public static function &fields() {
91 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
92 Civi::$statics[__CLASS__]['fields'] = [
93 'id' => [
94 'name' => 'id',
95 'type' => CRM_Utils_Type::T_INT,
96 'title' => ts('Group Nesting ID'),
97 'description' => ts('Relationship ID'),
98 'required' => TRUE,
99 'where' => 'civicrm_group_nesting.id',
100 'table_name' => 'civicrm_group_nesting',
101 'entity' => 'GroupNesting',
102 'bao' => 'CRM_Contact_BAO_GroupNesting',
103 'localizable' => 0,
104 'add' => '2.0',
105 ],
106 'child_group_id' => [
107 'name' => 'child_group_id',
108 'type' => CRM_Utils_Type::T_INT,
109 'title' => ts('Child Group'),
110 'description' => ts('ID of the child group'),
111 'required' => TRUE,
112 'where' => 'civicrm_group_nesting.child_group_id',
113 'table_name' => 'civicrm_group_nesting',
114 'entity' => 'GroupNesting',
115 'bao' => 'CRM_Contact_BAO_GroupNesting',
116 'localizable' => 0,
117 'FKClassName' => 'CRM_Contact_DAO_Group',
118 'add' => '2.0',
119 ],
120 'parent_group_id' => [
121 'name' => 'parent_group_id',
122 'type' => CRM_Utils_Type::T_INT,
123 'title' => ts('Parent Group'),
124 'description' => ts('ID of the parent group'),
125 'required' => TRUE,
126 'where' => 'civicrm_group_nesting.parent_group_id',
127 'table_name' => 'civicrm_group_nesting',
128 'entity' => 'GroupNesting',
129 'bao' => 'CRM_Contact_BAO_GroupNesting',
130 'localizable' => 0,
131 'FKClassName' => 'CRM_Contact_DAO_Group',
132 'add' => '2.0',
133 ],
134 ];
135 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
136 }
137 return Civi::$statics[__CLASS__]['fields'];
138 }
139
140 /**
141 * Return a mapping from field-name to the corresponding key (as used in fields()).
142 *
143 * @return array
144 * Array(string $name => string $uniqueName).
145 */
146 public static function &fieldKeys() {
147 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
148 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
149 }
150 return Civi::$statics[__CLASS__]['fieldKeys'];
151 }
152
153 /**
154 * Returns the names of this table
155 *
156 * @return string
157 */
158 public static function getTableName() {
159 return self::$_tableName;
160 }
161
162 /**
163 * Returns if this table needs to be logged
164 *
165 * @return bool
166 */
167 public function getLog() {
168 return self::$_log;
169 }
170
171 /**
172 * Returns the list of fields that can be imported
173 *
174 * @param bool $prefix
175 *
176 * @return array
177 */
178 public static function &import($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_nesting', $prefix, []);
180 return $r;
181 }
182
183 /**
184 * Returns the list of fields that can be exported
185 *
186 * @param bool $prefix
187 *
188 * @return array
189 */
190 public static function &export($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_nesting', $prefix, []);
192 return $r;
193 }
194
195 /**
196 * Returns the list of indices
197 *
198 * @param bool $localize
199 *
200 * @return array
201 */
202 public static function indices($localize = TRUE) {
203 $indices = [];
204 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
205 }
206
207 }