5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contact/GroupOrganization.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:12abfd5fb4d2eef796fec3a526338538)
13 * Database access object for the GroupOrganization entity.
15 class CRM_Contact_DAO_GroupOrganization
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_group_organization';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
46 * ID of the Organization Contact
50 public $organization_id;
55 public function __construct() {
56 $this->__table
= 'civicrm_group_organization';
57 parent
::__construct();
61 * Returns localized title of this entity.
63 public static function getEntityTitle() {
64 return ts('Group Organizations');
68 * Returns foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
77 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'organization_id', 'civicrm_contact', 'id');
78 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
80 return Civi
::$statics[__CLASS__
]['links'];
84 * Returns all the column names of this table
88 public static function &fields() {
89 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
90 Civi
::$statics[__CLASS__
]['fields'] = [
93 'type' => CRM_Utils_Type
::T_INT
,
94 'title' => ts('Group Organization ID'),
95 'description' => ts('Relationship ID'),
97 'where' => 'civicrm_group_organization.id',
98 'table_name' => 'civicrm_group_organization',
99 'entity' => 'GroupOrganization',
100 'bao' => 'CRM_Contact_BAO_GroupOrganization',
104 'name' => 'group_id',
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Group'),
107 'description' => ts('ID of the group'),
109 'where' => 'civicrm_group_organization.group_id',
110 'table_name' => 'civicrm_group_organization',
111 'entity' => 'GroupOrganization',
112 'bao' => 'CRM_Contact_BAO_GroupOrganization',
114 'FKClassName' => 'CRM_Contact_DAO_Group',
118 'pseudoconstant' => [
119 'table' => 'civicrm_group',
121 'labelColumn' => 'title',
124 'organization_id' => [
125 'name' => 'organization_id',
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Organization'),
128 'description' => ts('ID of the Organization Contact'),
130 'where' => 'civicrm_group_organization.organization_id',
131 'table_name' => 'civicrm_group_organization',
132 'entity' => 'GroupOrganization',
133 'bao' => 'CRM_Contact_BAO_GroupOrganization',
135 'FKClassName' => 'CRM_Contact_DAO_Contact',
138 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
140 return Civi
::$statics[__CLASS__
]['fields'];
144 * Return a mapping from field-name to the corresponding key (as used in fields()).
147 * Array(string $name => string $uniqueName).
149 public static function &fieldKeys() {
150 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
151 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
153 return Civi
::$statics[__CLASS__
]['fieldKeys'];
157 * Returns the names of this table
161 public static function getTableName() {
162 return self
::$_tableName;
166 * Returns if this table needs to be logged
170 public function getLog() {
175 * Returns the list of fields that can be imported
177 * @param bool $prefix
181 public static function &import($prefix = FALSE) {
182 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_organization', $prefix, []);
187 * Returns the list of fields that can be exported
189 * @param bool $prefix
193 public static function &export($prefix = FALSE) {
194 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_organization', $prefix, []);
199 * Returns the list of indices
201 * @param bool $localize
205 public static function indices($localize = TRUE) {
207 'UI_group_organization' => [
208 'name' => 'UI_group_organization',
211 1 => 'organization_id',
213 'localizable' => FALSE,
215 'sig' => 'civicrm_group_organization::1::group_id::organization_id',
218 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;