3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/OpenID.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:cf502fe1aae4bbe85faa570c2c341336)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_OpenID constructor.
40 class CRM_Core_DAO_OpenID
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_openid';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * Which Location does this email belong to.
70 public $location_type_id;
72 * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
78 * Whether or not this user is allowed to login
82 public $allowed_to_login;
84 * Is this the primary email for this contact and location.
92 function __construct() {
93 $this->__table
= 'civicrm_openid';
94 parent
::__construct();
97 * Returns foreign keys and entity references.
100 * [CRM_Core_Reference_Interface]
102 static function getReferenceColumns() {
103 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
104 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
106 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
108 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = array(
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Open ID identifier') ,
122 'description' => 'Unique OpenID ID',
124 'table_name' => 'civicrm_openid',
125 'entity' => 'OpenID',
126 'bao' => 'CRM_Core_BAO_OpenID',
129 'contact_id' => array(
130 'name' => 'contact_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('OpenID Contact') ,
133 'description' => 'FK to Contact ID',
134 'table_name' => 'civicrm_openid',
135 'entity' => 'OpenID',
136 'bao' => 'CRM_Core_BAO_OpenID',
138 'FKClassName' => 'CRM_Contact_DAO_Contact',
140 'location_type_id' => array(
141 'name' => 'location_type_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('OpenID Location Type') ,
144 'description' => 'Which Location does this email belong to.',
145 'table_name' => 'civicrm_openid',
146 'entity' => 'OpenID',
147 'bao' => 'CRM_Core_BAO_OpenID',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('OpenID') ,
154 'description' => 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM',
156 'size' => CRM_Utils_Type
::HUGE
,
158 'where' => 'civicrm_openid.openid',
159 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
160 'dataPattern' => '/^[\w\/\:\.]+$/',
163 'table_name' => 'civicrm_openid',
164 'entity' => 'OpenID',
165 'bao' => 'CRM_Core_BAO_OpenID',
168 'allowed_to_login' => array(
169 'name' => 'allowed_to_login',
170 'type' => CRM_Utils_Type
::T_BOOLEAN
,
171 'title' => ts('Allowed to login?') ,
172 'description' => 'Whether or not this user is allowed to login',
174 'table_name' => 'civicrm_openid',
175 'entity' => 'OpenID',
176 'bao' => 'CRM_Core_BAO_OpenID',
179 'is_primary' => array(
180 'name' => 'is_primary',
181 'type' => CRM_Utils_Type
::T_BOOLEAN
,
182 'title' => ts('Is OpenID Primary?') ,
183 'description' => 'Is this the primary email for this contact and location.',
184 'table_name' => 'civicrm_openid',
185 'entity' => 'OpenID',
186 'bao' => 'CRM_Core_BAO_OpenID',
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
192 return Civi
::$statics[__CLASS__
]['fields'];
195 * Return a mapping from field-name to the corresponding key (as used in fields()).
198 * Array(string $name => string $uniqueName).
200 static function &fieldKeys() {
201 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
202 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
204 return Civi
::$statics[__CLASS__
]['fieldKeys'];
207 * Returns the names of this table
211 static function getTableName() {
212 return self
::$_tableName;
215 * Returns if this table needs to be logged
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 static function &import($prefix = false) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, array());
234 * Returns the list of fields that can be exported
236 * @param bool $prefix
240 static function &export($prefix = false) {
241 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, array());
245 * Returns the list of indices
247 public static function indices($localize = TRUE) {
249 'index_location_type' => array(
250 'name' => 'index_location_type',
252 0 => 'location_type_id',
254 'localizable' => false,
255 'sig' => 'civicrm_openid::0::location_type_id',
257 'UI_openid' => array(
258 'name' => 'UI_openid',
262 'localizable' => false,
264 'sig' => 'civicrm_openid::1::openid',
267 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;