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:dfe8edf8f786790af95f09f456d1cbe7)
13 * Database access object for the GroupOrganization entity.
15 class CRM_Contact_DAO_GroupOrganization
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_organization';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
48 * ID of the Organization Contact
52 public $organization_id;
57 public function __construct() {
58 $this->__table
= 'civicrm_group_organization';
59 parent
::__construct();
63 * Returns localized title of this entity.
65 public static function getEntityTitle() {
66 return ts('Group Organizations');
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(), 'group_id', 'civicrm_group', 'id');
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'organization_id', 'civicrm_contact', '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 Organization ID'),
97 'description' => ts('Relationship ID'),
99 'where' => 'civicrm_group_organization.id',
100 'table_name' => 'civicrm_group_organization',
101 'entity' => 'GroupOrganization',
102 'bao' => 'CRM_Contact_BAO_GroupOrganization',
107 'name' => 'group_id',
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Group'),
110 'description' => ts('ID of the group'),
112 'where' => 'civicrm_group_organization.group_id',
113 'table_name' => 'civicrm_group_organization',
114 'entity' => 'GroupOrganization',
115 'bao' => 'CRM_Contact_BAO_GroupOrganization',
117 'FKClassName' => 'CRM_Contact_DAO_Group',
121 'pseudoconstant' => [
122 'table' => 'civicrm_group',
124 'labelColumn' => 'title',
128 'organization_id' => [
129 'name' => 'organization_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Organization'),
132 'description' => ts('ID of the Organization Contact'),
134 'where' => 'civicrm_group_organization.organization_id',
135 'table_name' => 'civicrm_group_organization',
136 'entity' => 'GroupOrganization',
137 'bao' => 'CRM_Contact_BAO_GroupOrganization',
139 'FKClassName' => 'CRM_Contact_DAO_Contact',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_organization', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_organization', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
212 'UI_group_organization' => [
213 'name' => 'UI_group_organization',
216 1 => 'organization_id',
218 'localizable' => FALSE,
220 'sig' => 'civicrm_group_organization::1::group_id::organization_id',
223 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;