5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/OpenID.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4baa608e9caa3e118ac02d28032b8bc2)
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 public static $_tableName = 'civicrm_openid';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_openid.id',
111 'table_name' => 'civicrm_openid',
112 'entity' => 'OpenID',
113 'bao' => 'CRM_Core_BAO_OpenID',
117 'name' => 'contact_id',
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('OpenID Contact'),
120 'description' => ts('FK to Contact ID'),
121 'where' => 'civicrm_openid.contact_id',
122 'table_name' => 'civicrm_openid',
123 'entity' => 'OpenID',
124 'bao' => 'CRM_Core_BAO_OpenID',
126 'FKClassName' => 'CRM_Contact_DAO_Contact',
128 'location_type_id' => [
129 'name' => 'location_type_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('OpenID Location Type'),
132 'description' => ts('Which Location does this email belong to.'),
133 'where' => 'civicrm_openid.location_type_id',
134 'table_name' => 'civicrm_openid',
135 'entity' => 'OpenID',
136 'bao' => 'CRM_Core_BAO_OpenID',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('OpenID'),
143 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
145 'size' => CRM_Utils_Type
::HUGE
,
147 'where' => 'civicrm_openid.openid',
148 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
149 'dataPattern' => '/^[\w\/\:\.]+$/',
152 'table_name' => 'civicrm_openid',
153 'entity' => 'OpenID',
154 'bao' => 'CRM_Core_BAO_OpenID',
157 'allowed_to_login' => [
158 'name' => 'allowed_to_login',
159 'type' => CRM_Utils_Type
::T_BOOLEAN
,
160 'title' => ts('Allowed to login?'),
161 'description' => ts('Whether or not this user is allowed to login'),
163 'where' => 'civicrm_openid.allowed_to_login',
165 'table_name' => 'civicrm_openid',
166 'entity' => 'OpenID',
167 'bao' => 'CRM_Core_BAO_OpenID',
171 'name' => 'is_primary',
172 'type' => CRM_Utils_Type
::T_BOOLEAN
,
173 'title' => ts('Primary ID'),
174 'description' => ts('Is this the primary email for this contact and location.'),
175 'where' => 'civicrm_openid.is_primary',
177 'table_name' => 'civicrm_openid',
178 'entity' => 'OpenID',
179 'bao' => 'CRM_Core_BAO_OpenID',
186 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
188 return Civi
::$statics[__CLASS__
]['fields'];
192 * Return a mapping from field-name to the corresponding key (as used in fields()).
195 * Array(string $name => string $uniqueName).
197 public static function &fieldKeys() {
198 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
199 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
201 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 public static function getTableName() {
210 return self
::$_tableName;
214 * Returns if this table needs to be logged
218 public function getLog() {
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, []);
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, []);
247 * Returns the list of indices
249 * @param bool $localize
253 public static function indices($localize = TRUE) {
255 'index_location_type' => [
256 'name' => 'index_location_type',
258 0 => 'location_type_id',
260 'localizable' => FALSE,
261 'sig' => 'civicrm_openid::0::location_type_id',
264 'name' => 'UI_openid',
268 'localizable' => FALSE,
270 'sig' => 'civicrm_openid::1::openid',
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;