5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contact/GroupNesting.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0ca7da77b0229b439c9c3a4c4c2e4326)
13 * Database access object for the GroupNesting entity.
15 class CRM_Contact_DAO_GroupNesting
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_group_nesting';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * ID of the child group
45 public $child_group_id;
48 * ID of the parent group
52 public $parent_group_id;
57 public function __construct() {
58 $this->__table
= 'civicrm_group_nesting';
59 parent
::__construct();
63 * Returns localized title of this entity.
65 public static function getEntityTitle() {
66 return ts('Group Nestings');
70 * Returns foreign keys and entity references.
73 * [CRM_Core_Reference_Interface]
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']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Group Nesting ID'),
97 'description' => ts('Relationship ID'),
99 'where' => 'civicrm_group_nesting.id',
100 'table_name' => 'civicrm_group_nesting',
101 'entity' => 'GroupNesting',
102 'bao' => 'CRM_Contact_BAO_GroupNesting',
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'),
112 'where' => 'civicrm_group_nesting.child_group_id',
113 'table_name' => 'civicrm_group_nesting',
114 'entity' => 'GroupNesting',
115 'bao' => 'CRM_Contact_BAO_GroupNesting',
117 'FKClassName' => 'CRM_Contact_DAO_Group',
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'),
126 'where' => 'civicrm_group_nesting.parent_group_id',
127 'table_name' => 'civicrm_group_nesting',
128 'entity' => 'GroupNesting',
129 'bao' => 'CRM_Contact_BAO_GroupNesting',
131 'FKClassName' => 'CRM_Contact_DAO_Group',
135 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
137 return Civi
::$statics[__CLASS__
]['fields'];
141 * Return a mapping from field-name to the corresponding key (as used in fields()).
144 * Array(string $name => string $uniqueName).
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()));
150 return Civi
::$statics[__CLASS__
]['fieldKeys'];
154 * Returns the names of this table
158 public static function getTableName() {
159 return self
::$_tableName;
163 * Returns if this table needs to be logged
167 public function getLog() {
172 * Returns the list of fields that can be imported
174 * @param bool $prefix
178 public static function &import($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_nesting', $prefix, []);
184 * Returns the list of fields that can be exported
186 * @param bool $prefix
190 public static function &export($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_nesting', $prefix, []);
196 * Returns the list of indices
198 * @param bool $localize
202 public static function indices($localize = TRUE) {
204 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;