5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Contact/GroupOrganization.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c921c7d49f23f8d8afa07773da5b5da3)
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 foreign keys and entity references.
64 * [CRM_Core_Reference_Interface]
66 public static function getReferenceColumns() {
67 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
68 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
69 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
70 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'organization_id', 'civicrm_contact', 'id');
71 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
73 return Civi
::$statics[__CLASS__
]['links'];
77 * Returns all the column names of this table
81 public static function &fields() {
82 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
83 Civi
::$statics[__CLASS__
]['fields'] = [
86 'type' => CRM_Utils_Type
::T_INT
,
87 'title' => ts('Group Organization ID'),
88 'description' => ts('Relationship ID'),
90 'where' => 'civicrm_group_organization.id',
91 'table_name' => 'civicrm_group_organization',
92 'entity' => 'GroupOrganization',
93 'bao' => 'CRM_Contact_BAO_GroupOrganization',
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Group'),
100 'description' => ts('ID of the group'),
102 'where' => 'civicrm_group_organization.group_id',
103 'table_name' => 'civicrm_group_organization',
104 'entity' => 'GroupOrganization',
105 'bao' => 'CRM_Contact_BAO_GroupOrganization',
107 'FKClassName' => 'CRM_Contact_DAO_Group',
111 'pseudoconstant' => [
112 'table' => 'civicrm_group',
114 'labelColumn' => 'title',
117 'organization_id' => [
118 'name' => 'organization_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Organization'),
121 'description' => ts('ID of the Organization Contact'),
123 'where' => 'civicrm_group_organization.organization_id',
124 'table_name' => 'civicrm_group_organization',
125 'entity' => 'GroupOrganization',
126 'bao' => 'CRM_Contact_BAO_GroupOrganization',
128 'FKClassName' => 'CRM_Contact_DAO_Contact',
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
133 return Civi
::$statics[__CLASS__
]['fields'];
137 * Return a mapping from field-name to the corresponding key (as used in fields()).
140 * Array(string $name => string $uniqueName).
142 public static function &fieldKeys() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
144 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
146 return Civi
::$statics[__CLASS__
]['fieldKeys'];
150 * Returns the names of this table
154 public static function getTableName() {
155 return self
::$_tableName;
159 * Returns if this table needs to be logged
163 public function getLog() {
168 * Returns the list of fields that can be imported
170 * @param bool $prefix
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_organization', $prefix, []);
180 * Returns the list of fields that can be exported
182 * @param bool $prefix
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_organization', $prefix, []);
192 * Returns the list of indices
194 * @param bool $localize
198 public static function indices($localize = TRUE) {
200 'UI_group_organization' => [
201 'name' => 'UI_group_organization',
204 1 => 'organization_id',
206 'localizable' => FALSE,
208 'sig' => 'civicrm_group_organization::1::group_id::organization_id',
211 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;