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:4fcc767aa82b542cd813a9de097a322c)
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 localized title of this entity.
84 public static function getEntityTitle() {
85 return ts('Open IDs');
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
98 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
100 return Civi
::$statics[__CLASS__
]['links'];
104 * Returns all the column names of this table
108 public static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = [
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Open ID identifier'),
115 'description' => ts('Unique OpenID ID'),
117 'where' => 'civicrm_openid.id',
118 'table_name' => 'civicrm_openid',
119 'entity' => 'OpenID',
120 'bao' => 'CRM_Core_BAO_OpenID',
124 'name' => 'contact_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('OpenID Contact'),
127 'description' => ts('FK to Contact ID'),
128 'where' => 'civicrm_openid.contact_id',
129 'table_name' => 'civicrm_openid',
130 'entity' => 'OpenID',
131 'bao' => 'CRM_Core_BAO_OpenID',
133 'FKClassName' => 'CRM_Contact_DAO_Contact',
135 'location_type_id' => [
136 'name' => 'location_type_id',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('OpenID Location Type'),
139 'description' => ts('Which Location does this email belong to.'),
140 'where' => 'civicrm_openid.location_type_id',
141 'table_name' => 'civicrm_openid',
142 'entity' => 'OpenID',
143 'bao' => 'CRM_Core_BAO_OpenID',
145 'pseudoconstant' => [
146 'table' => 'civicrm_location_type',
148 'labelColumn' => 'display_name',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('OpenID'),
155 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
157 'size' => CRM_Utils_Type
::HUGE
,
159 'where' => 'civicrm_openid.openid',
160 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
161 'dataPattern' => '/^[\w\/\:\.]+$/',
164 'table_name' => 'civicrm_openid',
165 'entity' => 'OpenID',
166 'bao' => 'CRM_Core_BAO_OpenID',
169 'allowed_to_login' => [
170 'name' => 'allowed_to_login',
171 'type' => CRM_Utils_Type
::T_BOOLEAN
,
172 'title' => ts('Allowed to login?'),
173 'description' => ts('Whether or not this user is allowed to login'),
175 'where' => 'civicrm_openid.allowed_to_login',
177 'table_name' => 'civicrm_openid',
178 'entity' => 'OpenID',
179 'bao' => 'CRM_Core_BAO_OpenID',
183 'name' => 'is_primary',
184 'type' => CRM_Utils_Type
::T_BOOLEAN
,
185 'title' => ts('Primary ID'),
186 'description' => ts('Is this the primary email for this contact and location.'),
187 'where' => 'civicrm_openid.is_primary',
189 'table_name' => 'civicrm_openid',
190 'entity' => 'OpenID',
191 'bao' => 'CRM_Core_BAO_OpenID',
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
200 return Civi
::$statics[__CLASS__
]['fields'];
204 * Return a mapping from field-name to the corresponding key (as used in fields()).
207 * Array(string $name => string $uniqueName).
209 public static function &fieldKeys() {
210 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
211 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
213 return Civi
::$statics[__CLASS__
]['fieldKeys'];
217 * Returns the names of this table
221 public static function getTableName() {
222 return self
::$_tableName;
226 * Returns if this table needs to be logged
230 public function getLog() {
235 * Returns the list of fields that can be imported
237 * @param bool $prefix
241 public static function &import($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, []);
247 * Returns the list of fields that can be exported
249 * @param bool $prefix
253 public static function &export($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, []);
259 * Returns the list of indices
261 * @param bool $localize
265 public static function indices($localize = TRUE) {
267 'index_location_type' => [
268 'name' => 'index_location_type',
270 0 => 'location_type_id',
272 'localizable' => FALSE,
273 'sig' => 'civicrm_openid::0::location_type_id',
276 'name' => 'UI_openid',
280 'localizable' => FALSE,
282 'sig' => 'civicrm_openid::1::openid',
285 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;