First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
234
sites/all/modules/civicrm/CRM/Contact/DAO/ACLContactCache.php
Normal file
234
sites/all/modules/civicrm/CRM/Contact/DAO/ACLContactCache.php
Normal file
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/ACLContactCache.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:09f2e2cc85dd5a51fa2c23ec4f8dc6ee)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_ACLContactCache constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_ACLContactCache extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_acl_contact_cache';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* primary key
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* FK to civicrm_contact (could be null for anon user)
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $user_id;
|
||||
/**
|
||||
* FK to civicrm_contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* What operation does this user have permission on?
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $operation;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_acl_contact_cache';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'user_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('ACL Contact Cache ID') ,
|
||||
'description' => 'primary key',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_acl_contact_cache',
|
||||
'entity' => 'ACLContactCache',
|
||||
'bao' => 'CRM_Contact_DAO_ACLContactCache',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'user_id' => array(
|
||||
'name' => 'user_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to civicrm_contact (could be null for anon user)',
|
||||
'table_name' => 'civicrm_acl_contact_cache',
|
||||
'entity' => 'ACLContactCache',
|
||||
'bao' => 'CRM_Contact_DAO_ACLContactCache',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to civicrm_contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_acl_contact_cache',
|
||||
'entity' => 'ACLContactCache',
|
||||
'bao' => 'CRM_Contact_DAO_ACLContactCache',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'operation' => array(
|
||||
'name' => 'operation',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Operation') ,
|
||||
'description' => 'What operation does this user have permission on?',
|
||||
'required' => true,
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'table_name' => 'civicrm_acl_contact_cache',
|
||||
'entity' => 'ACLContactCache',
|
||||
'bao' => 'CRM_Contact_DAO_ACLContactCache',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_ACL_BAO_ACL::operation',
|
||||
)
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_contact_cache', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_contact_cache', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_user_contact_operation' => array(
|
||||
'name' => 'UI_user_contact_operation',
|
||||
'field' => array(
|
||||
0 => 'user_id',
|
||||
1 => 'contact_id',
|
||||
2 => 'operation',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
1573
sites/all/modules/civicrm/CRM/Contact/DAO/Contact.php
Normal file
1573
sites/all/modules/civicrm/CRM/Contact/DAO/Contact.php
Normal file
File diff suppressed because it is too large
Load diff
301
sites/all/modules/civicrm/CRM/Contact/DAO/ContactType.php
Normal file
301
sites/all/modules/civicrm/CRM/Contact/DAO/ContactType.php
Normal file
|
@ -0,0 +1,301 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/ContactType.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:0323c01f0e0b176df66fe4fa02e0a342)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_ContactType constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_ContactType extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contact_type';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* Contact Type ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Internal name of Contact Type (or Subtype).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* localized Name of Contact Type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label;
|
||||
/**
|
||||
* localized Optional verbose description of the type.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* URL of image if any.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $image_URL;
|
||||
/**
|
||||
* Optional FK to parent contact type.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $parent_id;
|
||||
/**
|
||||
* Is this entry active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Is this contact type a predefined system type
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_reserved;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contact_type';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_contact_type', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact Type ID') ,
|
||||
'description' => 'Contact Type ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'name' => array(
|
||||
'name' => 'name',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Name') ,
|
||||
'description' => 'Internal name of Contact Type (or Subtype).',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'label' => array(
|
||||
'name' => 'label',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Type Label') ,
|
||||
'description' => 'localized Name of Contact Type.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Contact Type Description') ,
|
||||
'description' => 'localized Optional verbose description of the type.',
|
||||
'rows' => 2,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'image_URL' => array(
|
||||
'name' => 'image_URL',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Type Image URL') ,
|
||||
'description' => 'URL of image if any.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'parent_id' => array(
|
||||
'name' => 'parent_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact Type Parent') ,
|
||||
'description' => 'Optional FK to parent contact type.',
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_ContactType',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contact_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'label',
|
||||
'condition' => 'parent_id IS NULL',
|
||||
)
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Contact Type Is Active?') ,
|
||||
'description' => 'Is this entry active?',
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_reserved' => array(
|
||||
'name' => 'is_reserved',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Contact Type is Reserved?') ,
|
||||
'description' => 'Is this contact type a predefined system type',
|
||||
'table_name' => 'civicrm_contact_type',
|
||||
'entity' => 'ContactType',
|
||||
'bao' => 'CRM_Contact_BAO_ContactType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contact_type', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contact_type', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'contact_type' => array(
|
||||
'name' => 'contact_type',
|
||||
'field' => array(
|
||||
0 => 'name',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_contact_type::1::name',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
255
sites/all/modules/civicrm/CRM/Contact/DAO/DashboardContact.php
Normal file
255
sites/all/modules/civicrm/CRM/Contact/DAO/DashboardContact.php
Normal file
|
@ -0,0 +1,255 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/DashboardContact.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:bcefe0743f9e78a86266236b31f37fe4)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_DashboardContact constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_dashboard_contact';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Dashboard ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $dashboard_id;
|
||||
/**
|
||||
* Contact ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* column no for this widget
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $column_no;
|
||||
/**
|
||||
* Is this widget active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Ordering of the widgets.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $weight;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_dashboard_contact';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dashboard_id', 'civicrm_dashboard', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Dashboard Contact ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'dashboard_id' => array(
|
||||
'name' => 'dashboard_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Dashboard') ,
|
||||
'description' => 'Dashboard ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Core_DAO_Dashboard',
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Dashboard Contact') ,
|
||||
'description' => 'Contact ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'column_no' => array(
|
||||
'name' => 'column_no',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Column No') ,
|
||||
'description' => 'column no for this widget',
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Dashlet is Active?') ,
|
||||
'description' => 'Is this widget active?',
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'weight' => array(
|
||||
'name' => 'weight',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Order') ,
|
||||
'description' => 'Ordering of the widgets.',
|
||||
'table_name' => 'civicrm_dashboard_contact',
|
||||
'entity' => 'DashboardContact',
|
||||
'bao' => 'CRM_Contact_BAO_DashboardContact',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard_contact', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard_contact', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'index_dashboard_id_contact_id' => array(
|
||||
'name' => 'index_dashboard_id_contact_id',
|
||||
'field' => array(
|
||||
0 => 'dashboard_id',
|
||||
1 => 'contact_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
55
sites/all/modules/civicrm/CRM/Contact/DAO/Factory.php
Normal file
55
sites/all/modules/civicrm/CRM/Contact/DAO/Factory.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Class CRM_Contact_DAO_Factory
|
||||
*/
|
||||
class CRM_Contact_DAO_Factory {
|
||||
|
||||
static $_classes = array(
|
||||
'Address' => 'data',
|
||||
'Contact' => 'data',
|
||||
'Email' => 'data',
|
||||
'Household' => 'data',
|
||||
'IM' => 'data',
|
||||
'Individual' => 'data',
|
||||
'Location' => 'data',
|
||||
'LocationType' => 'data',
|
||||
'Organization' => 'data',
|
||||
'Phone' => 'data',
|
||||
'Relationship' => 'data',
|
||||
);
|
||||
|
||||
static $_prefix = array(
|
||||
'business' => 'CRM/Contact/BAO/',
|
||||
'data' => 'CRM/Contact/DAO/',
|
||||
);
|
||||
|
||||
static $_suffix = '.php';
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
static function &create($className) {
|
||||
$type = CRM_Utils_Array::value($className, self::$_classes);
|
||||
if (!$type) {
|
||||
return CRM_Core_DAO_Factory::create($className);
|
||||
}
|
||||
|
||||
$file = self::$_prefix[$type] . $className;
|
||||
$class = str_replace('/', '_', $file);
|
||||
|
||||
require_once($file . self::$_suffix);
|
||||
|
||||
if ($type == 'singleton') {
|
||||
$newObj = $class::singleton();
|
||||
}
|
||||
else {
|
||||
// this is either 'business' or 'data'
|
||||
$newObj = new $class;
|
||||
}
|
||||
|
||||
return $newObj;
|
||||
}
|
||||
}
|
523
sites/all/modules/civicrm/CRM/Contact/DAO/Group.php
Normal file
523
sites/all/modules/civicrm/CRM/Contact/DAO/Group.php
Normal file
|
@ -0,0 +1,523 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/Group.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:4c9dfb678f18129fd9d667de3727dfeb)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_Group constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_Group extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_group';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Group ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Internal name of Group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* Name of Group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* Optional verbose description of the group.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* Module or process which created this group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $source;
|
||||
/**
|
||||
* FK to saved search table.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $saved_search_id;
|
||||
/**
|
||||
* Is this entry active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* In what context(s) is this field visible.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $visibility;
|
||||
/**
|
||||
* the sql where clause if a saved search acl
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $where_clause;
|
||||
/**
|
||||
* the tables to be included in a select data
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $select_tables;
|
||||
/**
|
||||
* the tables to be included in the count statement
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $where_tables;
|
||||
/**
|
||||
* FK to group type
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $group_type;
|
||||
/**
|
||||
* Date when we created the cache for a smart group
|
||||
*
|
||||
* @var timestamp
|
||||
*/
|
||||
public $cache_date;
|
||||
/**
|
||||
* Date and time when we need to refresh the cache next.
|
||||
*
|
||||
* @var timestamp
|
||||
*/
|
||||
public $refresh_date;
|
||||
/**
|
||||
* IDs of the parent(s)
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $parents;
|
||||
/**
|
||||
* IDs of the child(ren)
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $children;
|
||||
/**
|
||||
* Is this group hidden?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_hidden;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_reserved;
|
||||
/**
|
||||
* FK to contact table.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $created_id;
|
||||
/**
|
||||
* FK to contact table.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $modified_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_group';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group ID') ,
|
||||
'description' => 'Group ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'name' => array(
|
||||
'name' => 'name',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Name') ,
|
||||
'description' => 'Internal name of Group.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'title' => array(
|
||||
'name' => 'title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Title') ,
|
||||
'description' => 'Name of Group.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Group Description') ,
|
||||
'description' => 'Optional verbose description of the group.',
|
||||
'rows' => 2,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'source' => array(
|
||||
'name' => 'source',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Source') ,
|
||||
'description' => 'Module or process which created this group.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'saved_search_id' => array(
|
||||
'name' => 'saved_search_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Saved Search ID') ,
|
||||
'description' => 'FK to saved search table.',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Group Enabled') ,
|
||||
'description' => 'Is this entry active?',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'visibility' => array(
|
||||
'name' => 'visibility',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Visibility Setting') ,
|
||||
'description' => 'In what context(s) is this field visible.',
|
||||
'maxlength' => 24,
|
||||
'size' => CRM_Utils_Type::MEDIUM,
|
||||
'default' => 'User and User Admin Only',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::groupVisibility',
|
||||
)
|
||||
) ,
|
||||
'where_clause' => array(
|
||||
'name' => 'where_clause',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Group Where Clause') ,
|
||||
'description' => 'the sql where clause if a saved search acl',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'select_tables' => array(
|
||||
'name' => 'select_tables',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Tables For Select Clause') ,
|
||||
'description' => 'the tables to be included in a select data',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'where_tables' => array(
|
||||
'name' => 'where_tables',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Tables For Where Clause') ,
|
||||
'description' => 'the tables to be included in the count statement',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'group_type' => array(
|
||||
'name' => 'group_type',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Type') ,
|
||||
'description' => 'FK to group type',
|
||||
'maxlength' => 128,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'group_type',
|
||||
'optionEditPath' => 'civicrm/admin/options/group_type',
|
||||
)
|
||||
) ,
|
||||
'cache_date' => array(
|
||||
'name' => 'cache_date',
|
||||
'type' => CRM_Utils_Type::T_TIMESTAMP,
|
||||
'title' => ts('Group Cache Date') ,
|
||||
'description' => 'Date when we created the cache for a smart group',
|
||||
'required' => false,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'refresh_date' => array(
|
||||
'name' => 'refresh_date',
|
||||
'type' => CRM_Utils_Type::T_TIMESTAMP,
|
||||
'title' => ts('Next Group Refresh Time') ,
|
||||
'description' => 'Date and time when we need to refresh the cache next.',
|
||||
'required' => false,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'parents' => array(
|
||||
'name' => 'parents',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Group Parents') ,
|
||||
'description' => 'IDs of the parent(s)',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'children' => array(
|
||||
'name' => 'children',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Group Children') ,
|
||||
'description' => 'IDs of the child(ren)',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_hidden' => array(
|
||||
'name' => 'is_hidden',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Group is Hidden') ,
|
||||
'description' => 'Is this group hidden?',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_reserved' => array(
|
||||
'name' => 'is_reserved',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Group is Reserved') ,
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'created_id' => array(
|
||||
'name' => 'created_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Created By') ,
|
||||
'description' => 'FK to contact table.',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'modified_id' => array(
|
||||
'name' => 'modified_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Modified By') ,
|
||||
'description' => 'FK to contact table.',
|
||||
'table_name' => 'civicrm_group',
|
||||
'entity' => 'Group',
|
||||
'bao' => 'CRM_Contact_BAO_Group',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'index_group_type' => array(
|
||||
'name' => 'index_group_type',
|
||||
'field' => array(
|
||||
0 => 'group_type',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_group::0::group_type',
|
||||
) ,
|
||||
'UI_title' => array(
|
||||
'name' => 'UI_title',
|
||||
'field' => array(
|
||||
0 => 'title',
|
||||
) ,
|
||||
'localizable' => true,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_group::1::title',
|
||||
) ,
|
||||
'UI_name' => array(
|
||||
'name' => 'UI_name',
|
||||
'field' => array(
|
||||
0 => 'name',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_group::1::name',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
277
sites/all/modules/civicrm/CRM/Contact/DAO/GroupContact.php
Normal file
277
sites/all/modules/civicrm/CRM/Contact/DAO/GroupContact.php
Normal file
|
@ -0,0 +1,277 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/GroupContact.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:2545d3926c711a25b5075a6ac980ed99)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_GroupContact constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_GroupContact extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_group_contact';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* primary key
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* FK to civicrm_group
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $group_id;
|
||||
/**
|
||||
* FK to civicrm_contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* status of contact relative to membership in group
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $status;
|
||||
/**
|
||||
* Optional location to associate with this membership
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $location_id;
|
||||
/**
|
||||
* Optional email to associate with this membership
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $email_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_group_contact';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_id', 'civicrm_loc_block', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Contact ID') ,
|
||||
'description' => 'primary key',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'group_id' => array(
|
||||
'name' => 'group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group ID') ,
|
||||
'description' => 'FK to civicrm_group',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_group',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to civicrm_contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'status' => array(
|
||||
'name' => 'status',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Contact Status') ,
|
||||
'description' => 'status of contact relative to membership in group',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::groupContactStatus',
|
||||
)
|
||||
) ,
|
||||
'location_id' => array(
|
||||
'name' => 'location_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Contact Location') ,
|
||||
'description' => 'Optional location to associate with this membership',
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Core_DAO_LocBlock',
|
||||
) ,
|
||||
'email_id' => array(
|
||||
'name' => 'email_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Contact Email') ,
|
||||
'description' => 'Optional email to associate with this membership',
|
||||
'table_name' => 'civicrm_group_contact',
|
||||
'entity' => 'GroupContact',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContact',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Core_DAO_Email',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_contact', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_contact', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_contact_group' => array(
|
||||
'name' => 'UI_contact_group',
|
||||
'field' => array(
|
||||
0 => 'contact_id',
|
||||
1 => 'group_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_group_contact::1::contact_id::group_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
217
sites/all/modules/civicrm/CRM/Contact/DAO/GroupContactCache.php
Normal file
217
sites/all/modules/civicrm/CRM/Contact/DAO/GroupContactCache.php
Normal file
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/GroupContactCache.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:2ee24826ad267586e2e757ce3b0442a1)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_GroupContactCache constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_GroupContactCache extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_group_contact_cache';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* primary key
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* FK to civicrm_group
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $group_id;
|
||||
/**
|
||||
* FK to civicrm_contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_group_contact_cache';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Contact Cache ID') ,
|
||||
'description' => 'primary key',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact_cache',
|
||||
'entity' => 'GroupContactCache',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContactCache',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'group_id' => array(
|
||||
'name' => 'group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group') ,
|
||||
'description' => 'FK to civicrm_group',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact_cache',
|
||||
'entity' => 'GroupContactCache',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContactCache',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_group',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to civicrm_contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_contact_cache',
|
||||
'entity' => 'GroupContactCache',
|
||||
'bao' => 'CRM_Contact_BAO_GroupContactCache',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_contact_cache', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_contact_cache', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_contact_group' => array(
|
||||
'name' => 'UI_contact_group',
|
||||
'field' => array(
|
||||
0 => 'contact_id',
|
||||
1 => 'group_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_group_contact_cache::1::contact_id::group_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
198
sites/all/modules/civicrm/CRM/Contact/DAO/GroupNesting.php
Normal file
198
sites/all/modules/civicrm/CRM/Contact/DAO/GroupNesting.php
Normal file
|
@ -0,0 +1,198 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/GroupNesting.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:00fc9bc828e1b87acf20aa16b24b1bac)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_GroupNesting constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_GroupNesting extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_group_nesting';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Relationship ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* ID of the child group
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $child_group_id;
|
||||
/**
|
||||
* ID of the parent group
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $parent_group_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_group_nesting';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'child_group_id', 'civicrm_group', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_group_id', 'civicrm_group', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Nesting ID') ,
|
||||
'description' => 'Relationship ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_nesting',
|
||||
'entity' => 'GroupNesting',
|
||||
'bao' => 'CRM_Contact_BAO_GroupNesting',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'child_group_id' => array(
|
||||
'name' => 'child_group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Child Group') ,
|
||||
'description' => 'ID of the child group',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_nesting',
|
||||
'entity' => 'GroupNesting',
|
||||
'bao' => 'CRM_Contact_BAO_GroupNesting',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
) ,
|
||||
'parent_group_id' => array(
|
||||
'name' => 'parent_group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Parent Group') ,
|
||||
'description' => 'ID of the parent group',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_nesting',
|
||||
'entity' => 'GroupNesting',
|
||||
'bao' => 'CRM_Contact_BAO_GroupNesting',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_nesting', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_nesting', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
217
sites/all/modules/civicrm/CRM/Contact/DAO/GroupOrganization.php
Normal file
217
sites/all/modules/civicrm/CRM/Contact/DAO/GroupOrganization.php
Normal file
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/GroupOrganization.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:8fcd7c11b9077c52f8d932eb20379618)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_GroupOrganization constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_GroupOrganization extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_group_organization';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Relationship ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* ID of the group
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $group_id;
|
||||
/**
|
||||
* ID of the Organization Contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $organization_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_group_organization';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'organization_id', 'civicrm_contact', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Organization ID') ,
|
||||
'description' => 'Relationship ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_organization',
|
||||
'entity' => 'GroupOrganization',
|
||||
'bao' => 'CRM_Contact_BAO_GroupOrganization',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'group_id' => array(
|
||||
'name' => 'group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group') ,
|
||||
'description' => 'ID of the group',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_organization',
|
||||
'entity' => 'GroupOrganization',
|
||||
'bao' => 'CRM_Contact_BAO_GroupOrganization',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_group',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'organization_id' => array(
|
||||
'name' => 'organization_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Organization') ,
|
||||
'description' => 'ID of the Organization Contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_group_organization',
|
||||
'entity' => 'GroupOrganization',
|
||||
'bao' => 'CRM_Contact_BAO_GroupOrganization',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_organization', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_organization', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_group_organization' => array(
|
||||
'name' => 'UI_group_organization',
|
||||
'field' => array(
|
||||
0 => 'group_id',
|
||||
1 => 'organization_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_group_organization::1::group_id::organization_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
365
sites/all/modules/civicrm/CRM/Contact/DAO/Relationship.php
Normal file
365
sites/all/modules/civicrm/CRM/Contact/DAO/Relationship.php
Normal file
|
@ -0,0 +1,365 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/Relationship.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:a5a833da9d5016f0aeb06ba7c1058b3c)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_Relationship constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_Relationship extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_relationship';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Relationship ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* id of the first contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id_a;
|
||||
/**
|
||||
* id of the second contact
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id_b;
|
||||
/**
|
||||
* id of the relationship
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $relationship_type_id;
|
||||
/**
|
||||
* date when the relationship started
|
||||
*
|
||||
* @var date
|
||||
*/
|
||||
public $start_date;
|
||||
/**
|
||||
* date when the relationship ended
|
||||
*
|
||||
* @var date
|
||||
*/
|
||||
public $end_date;
|
||||
/**
|
||||
* is the relationship active ?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Optional verbose description for the relationship.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* is contact a has permission to view / edit contact and
|
||||
related data for contact b ?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_permission_a_b;
|
||||
/**
|
||||
* is contact b has permission to view / edit contact and
|
||||
related data for contact a ?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_permission_b_a;
|
||||
/**
|
||||
* FK to civicrm_case
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $case_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_relationship';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id_a', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id_b', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'case_id', 'civicrm_case', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Relationship ID') ,
|
||||
'description' => 'Relationship ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contact_id_a' => array(
|
||||
'name' => 'contact_id_a',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact A') ,
|
||||
'description' => 'id of the first contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'contact_id_b' => array(
|
||||
'name' => 'contact_id_b',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact B') ,
|
||||
'description' => 'id of the second contact',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
'html' => array(
|
||||
'type' => 'EntityRef',
|
||||
) ,
|
||||
) ,
|
||||
'relationship_type_id' => array(
|
||||
'name' => 'relationship_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Relationship Type') ,
|
||||
'description' => 'id of the relationship',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
) ,
|
||||
'start_date' => array(
|
||||
'name' => 'start_date',
|
||||
'type' => CRM_Utils_Type::T_DATE,
|
||||
'title' => ts('Relationship Start Date') ,
|
||||
'description' => 'date when the relationship started',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'end_date' => array(
|
||||
'name' => 'end_date',
|
||||
'type' => CRM_Utils_Type::T_DATE,
|
||||
'title' => ts('Relationship End Date') ,
|
||||
'description' => 'date when the relationship ended',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Relationship Is Active') ,
|
||||
'description' => 'is the relationship active ?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Description') ,
|
||||
'description' => 'Optional verbose description for the relationship.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'is_permission_a_b' => array(
|
||||
'name' => 'is_permission_a_b',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Contact A has Permission Over Contact B') ,
|
||||
'description' => 'is contact a has permission to view / edit contact and
|
||||
related data for contact b ?
|
||||
',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'is_permission_b_a' => array(
|
||||
'name' => 'is_permission_b_a',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Contact B has Permission Over Contact A') ,
|
||||
'description' => 'is contact b has permission to view / edit contact and
|
||||
related data for contact a ?
|
||||
',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'case_id' => array(
|
||||
'name' => 'case_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Relationship Case') ,
|
||||
'description' => 'FK to civicrm_case',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_relationship',
|
||||
'entity' => 'Relationship',
|
||||
'bao' => 'CRM_Contact_BAO_Relationship',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Case_DAO_Case',
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'relationship', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'relationship', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
400
sites/all/modules/civicrm/CRM/Contact/DAO/RelationshipType.php
Normal file
400
sites/all/modules/civicrm/CRM/Contact/DAO/RelationshipType.php
Normal file
|
@ -0,0 +1,400 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/RelationshipType.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:8fb00d8376af049ce62bc57ca01bc1bf)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_RelationshipType constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_RelationshipType extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_relationship_type';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Primary key
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* name for relationship of contact_a to contact_b.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name_a_b;
|
||||
/**
|
||||
* label for relationship of contact_a to contact_b.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label_a_b;
|
||||
/**
|
||||
* Optional name for relationship of contact_b to contact_a.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name_b_a;
|
||||
/**
|
||||
* Optional label for relationship of contact_b to contact_a.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label_b_a;
|
||||
/**
|
||||
* Optional verbose description of the relationship type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* If defined, contact_a in a relationship of this type must be a specific contact_type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $contact_type_a;
|
||||
/**
|
||||
* If defined, contact_b in a relationship of this type must be a specific contact_type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $contact_type_b;
|
||||
/**
|
||||
* If defined, contact_sub_type_a in a relationship of this type must be a specific contact_sub_type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $contact_sub_type_a;
|
||||
/**
|
||||
* If defined, contact_sub_type_b in a relationship of this type must be a specific contact_sub_type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $contact_sub_type_b;
|
||||
/**
|
||||
* Is this relationship type a predefined system type (can not be changed or de-activated)?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_reserved;
|
||||
/**
|
||||
* Is this relationship type currently active (i.e. can be used when creating or editing relationships)?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_relationship_type';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Relationship Type ID') ,
|
||||
'description' => 'Primary key',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'name_a_b' => array(
|
||||
'name' => 'name_a_b',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Type Name A to B') ,
|
||||
'description' => 'name for relationship of contact_a to contact_b.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'label_a_b' => array(
|
||||
'name' => 'label_a_b',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Type Label A to B') ,
|
||||
'description' => 'label for relationship of contact_a to contact_b.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'name_b_a' => array(
|
||||
'name' => 'name_b_a',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Type Name B to A') ,
|
||||
'description' => 'Optional name for relationship of contact_b to contact_a.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'label_b_a' => array(
|
||||
'name' => 'label_b_a',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Type Label B to A') ,
|
||||
'description' => 'Optional label for relationship of contact_b to contact_a.',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Relationship Description') ,
|
||||
'description' => 'Optional verbose description of the relationship type.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'contact_type_a' => array(
|
||||
'name' => 'contact_type_a',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Type for Contact A') ,
|
||||
'description' => 'If defined, contact_a in a relationship of this type must be a specific contact_type.',
|
||||
'maxlength' => 12,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contact_type',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'label',
|
||||
'condition' => 'parent_id IS NULL',
|
||||
)
|
||||
) ,
|
||||
'contact_type_b' => array(
|
||||
'name' => 'contact_type_b',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Type for Contact B') ,
|
||||
'description' => 'If defined, contact_b in a relationship of this type must be a specific contact_type.',
|
||||
'maxlength' => 12,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contact_type',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'label',
|
||||
'condition' => 'parent_id IS NULL',
|
||||
)
|
||||
) ,
|
||||
'contact_sub_type_a' => array(
|
||||
'name' => 'contact_sub_type_a',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Subtype A') ,
|
||||
'description' => 'If defined, contact_sub_type_a in a relationship of this type must be a specific contact_sub_type.
|
||||
',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contact_type',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'label',
|
||||
'condition' => 'parent_id IS NOT NULL',
|
||||
)
|
||||
) ,
|
||||
'contact_sub_type_b' => array(
|
||||
'name' => 'contact_sub_type_b',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contact Subtype B') ,
|
||||
'description' => 'If defined, contact_sub_type_b in a relationship of this type must be a specific contact_sub_type.
|
||||
',
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contact_type',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'label',
|
||||
'condition' => 'parent_id IS NOT NULL',
|
||||
)
|
||||
) ,
|
||||
'is_reserved' => array(
|
||||
'name' => 'is_reserved',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Relationship Type is Reserved') ,
|
||||
'description' => 'Is this relationship type a predefined system type (can not be changed or de-activated)?',
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Relationship Type is Active') ,
|
||||
'description' => 'Is this relationship type currently active (i.e. can be used when creating or editing relationships)?
|
||||
',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_relationship_type',
|
||||
'entity' => 'RelationshipType',
|
||||
'bao' => 'CRM_Contact_BAO_RelationshipType',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'relationship_type', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'relationship_type', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_name_a_b' => array(
|
||||
'name' => 'UI_name_a_b',
|
||||
'field' => array(
|
||||
0 => 'name_a_b',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_relationship_type::1::name_a_b',
|
||||
) ,
|
||||
'UI_name_b_a' => array(
|
||||
'name' => 'UI_name_b_a',
|
||||
'field' => array(
|
||||
0 => 'name_b_a',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_relationship_type::1::name_b_a',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
263
sites/all/modules/civicrm/CRM/Contact/DAO/SavedSearch.php
Normal file
263
sites/all/modules/civicrm/CRM/Contact/DAO/SavedSearch.php
Normal file
|
@ -0,0 +1,263 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/SavedSearch.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:8e799b35db1b6a38deee5a757d4183c0)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_SavedSearch constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_saved_search';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = false;
|
||||
/**
|
||||
* Saved Search ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Submitted form values for this search
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $form_values;
|
||||
/**
|
||||
* Foreign key to civicrm_mapping used for saved search-builder searches.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $mapping_id;
|
||||
/**
|
||||
* Foreign key to civicrm_option value table used for saved custom searches.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $search_custom_id;
|
||||
/**
|
||||
* the sql where clause if a saved search acl
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $where_clause;
|
||||
/**
|
||||
* the tables to be included in a select data
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $select_tables;
|
||||
/**
|
||||
* the tables to be included in the count statement
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $where_tables;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_saved_search';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'mapping_id', 'civicrm_mapping', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Saved Search ID') ,
|
||||
'description' => 'Saved Search ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'form_values' => array(
|
||||
'name' => 'form_values',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Submitted Form Values') ,
|
||||
'description' => 'Submitted form values for this search',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_saved_search.form_values',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'mapping_id' => array(
|
||||
'name' => 'mapping_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Mapping ID') ,
|
||||
'description' => 'Foreign key to civicrm_mapping used for saved search-builder searches.',
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Core_DAO_Mapping',
|
||||
) ,
|
||||
'search_custom_id' => array(
|
||||
'name' => 'search_custom_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Option Value ID') ,
|
||||
'description' => 'Foreign key to civicrm_option value table used for saved custom searches.',
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'where_clause' => array(
|
||||
'name' => 'where_clause',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Where Clause') ,
|
||||
'description' => 'the sql where clause if a saved search acl',
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'select_tables' => array(
|
||||
'name' => 'select_tables',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Select Tables') ,
|
||||
'description' => 'the tables to be included in a select data',
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'where_tables' => array(
|
||||
'name' => 'where_tables',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Where Tables') ,
|
||||
'description' => 'the tables to be included in the count statement',
|
||||
'table_name' => 'civicrm_saved_search',
|
||||
'entity' => 'SavedSearch',
|
||||
'bao' => 'CRM_Contact_BAO_SavedSearch',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'saved_search', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'saved_search', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,286 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contact/SubscriptionHistory.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:8b7f0a4e3593bc26947b4bb6cf54c2d2)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contact_DAO_SubscriptionHistory constructor.
|
||||
*/
|
||||
class CRM_Contact_DAO_SubscriptionHistory extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_subscription_history';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Internal Id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Contact Id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* Group Id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $group_id;
|
||||
/**
|
||||
* Date of the (un)subscription
|
||||
*
|
||||
* @var timestamp
|
||||
*/
|
||||
public $date;
|
||||
/**
|
||||
* How the (un)subscription was triggered
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $method;
|
||||
/**
|
||||
* The state of the contact within the group
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $status;
|
||||
/**
|
||||
* IP address or other tracking info
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $tracking;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_subscription_history';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group Membership History ID') ,
|
||||
'description' => 'Internal Id',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'Contact Id',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'group_id' => array(
|
||||
'name' => 'group_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Group') ,
|
||||
'description' => 'Group Id',
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Group',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_group',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'date' => array(
|
||||
'name' => 'date',
|
||||
'type' => CRM_Utils_Type::T_TIMESTAMP,
|
||||
'title' => ts('Group Membership Action Date') ,
|
||||
'description' => 'Date of the (un)subscription',
|
||||
'required' => true,
|
||||
'default' => 'CURRENT_TIMESTAMP',
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'method' => array(
|
||||
'name' => 'method',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Membership Action') ,
|
||||
'description' => 'How the (un)subscription was triggered',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::getSubscriptionHistoryMethods',
|
||||
)
|
||||
) ,
|
||||
'status' => array(
|
||||
'name' => 'status',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Membership Status') ,
|
||||
'description' => 'The state of the contact within the group',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::groupContactStatus',
|
||||
)
|
||||
) ,
|
||||
'tracking' => array(
|
||||
'name' => 'tracking',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Group Membership Tracking') ,
|
||||
'description' => 'IP address or other tracking info',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_subscription_history',
|
||||
'entity' => 'SubscriptionHistory',
|
||||
'bao' => 'CRM_Contact_BAO_SubscriptionHistory',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'subscription_history', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'subscription_history', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue