5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/OpenID.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:8f43063bba0682c56356dbf7afa64658)
13 * Database access object for the OpenID entity.
15 class CRM_Core_DAO_OpenID
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_openid';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
46 * Which Location does this email belong to.
50 public $location_type_id;
53 * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
60 * Whether or not this user is allowed to login
64 public $allowed_to_login;
67 * Is this the primary email for this contact and location.
76 public function __construct() {
77 $this->__table
= 'civicrm_openid';
78 parent
::__construct();
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
91 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
93 return Civi
::$statics[__CLASS__
]['links'];
97 * Returns all the column names of this table
101 public static function &fields() {
102 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
103 Civi
::$statics[__CLASS__
]['fields'] = [
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Open ID identifier'),
108 'description' => ts('Unique OpenID ID'),
110 'table_name' => 'civicrm_openid',
111 'entity' => 'OpenID',
112 'bao' => 'CRM_Core_BAO_OpenID',
116 'name' => 'contact_id',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('OpenID Contact'),
119 'description' => ts('FK to Contact ID'),
120 'table_name' => 'civicrm_openid',
121 'entity' => 'OpenID',
122 'bao' => 'CRM_Core_BAO_OpenID',
124 'FKClassName' => 'CRM_Contact_DAO_Contact',
126 'location_type_id' => [
127 'name' => 'location_type_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('OpenID Location Type'),
130 'description' => ts('Which Location does this email belong to.'),
131 'table_name' => 'civicrm_openid',
132 'entity' => 'OpenID',
133 'bao' => 'CRM_Core_BAO_OpenID',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('OpenID'),
140 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
142 'size' => CRM_Utils_Type
::HUGE
,
144 'where' => 'civicrm_openid.openid',
145 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
146 'dataPattern' => '/^[\w\/\:\.]+$/',
149 'table_name' => 'civicrm_openid',
150 'entity' => 'OpenID',
151 'bao' => 'CRM_Core_BAO_OpenID',
154 'allowed_to_login' => [
155 'name' => 'allowed_to_login',
156 'type' => CRM_Utils_Type
::T_BOOLEAN
,
157 'title' => ts('Allowed to login?'),
158 'description' => ts('Whether or not this user is allowed to login'),
161 'table_name' => 'civicrm_openid',
162 'entity' => 'OpenID',
163 'bao' => 'CRM_Core_BAO_OpenID',
167 'name' => 'is_primary',
168 'type' => CRM_Utils_Type
::T_BOOLEAN
,
169 'title' => ts('Is OpenID Primary?'),
170 'description' => ts('Is this the primary email for this contact and location.'),
172 'table_name' => 'civicrm_openid',
173 'entity' => 'OpenID',
174 'bao' => 'CRM_Core_BAO_OpenID',
178 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
180 return Civi
::$statics[__CLASS__
]['fields'];
184 * Return a mapping from field-name to the corresponding key (as used in fields()).
187 * Array(string $name => string $uniqueName).
189 public static function &fieldKeys() {
190 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
191 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
193 return Civi
::$statics[__CLASS__
]['fieldKeys'];
197 * Returns the names of this table
201 public static function getTableName() {
202 return self
::$_tableName;
206 * Returns if this table needs to be logged
210 public function getLog() {
215 * Returns the list of fields that can be imported
217 * @param bool $prefix
221 public static function &import($prefix = FALSE) {
222 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, []);
227 * Returns the list of fields that can be exported
229 * @param bool $prefix
233 public static function &export($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, []);
239 * Returns the list of indices
241 * @param bool $localize
245 public static function indices($localize = TRUE) {
247 'index_location_type' => [
248 'name' => 'index_location_type',
250 0 => 'location_type_id',
252 'localizable' => FALSE,
253 'sig' => 'civicrm_openid::0::location_type_id',
256 'name' => 'UI_openid',
260 'localizable' => FALSE,
262 'sig' => 'civicrm_openid::1::openid',
265 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;