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:6547ff2f60e61de44f3ca5a866c1df6a)
13 * Database access object for the OpenID entity.
15 class CRM_Core_DAO_OpenID
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_openid';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
48 * Which Location does this email belong to.
52 public $location_type_id;
55 * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
62 * Whether or not this user is allowed to login
66 public $allowed_to_login;
69 * Is this the primary email for this contact and location.
78 public function __construct() {
79 $this->__table
= 'civicrm_openid';
80 parent
::__construct();
84 * Returns localized title of this entity.
87 * Whether to return the plural version of the title.
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ?
ts('Open IDs') : ts('Open ID');
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
99 public static function getReferenceColumns() {
100 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
101 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
103 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
105 return Civi
::$statics[__CLASS__
]['links'];
109 * Returns all the column names of this table
113 public static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = [
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Open ID identifier'),
120 'description' => ts('Unique OpenID ID'),
122 'where' => 'civicrm_openid.id',
123 'table_name' => 'civicrm_openid',
124 'entity' => 'OpenID',
125 'bao' => 'CRM_Core_BAO_OpenID',
134 'name' => 'contact_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Contact ID'),
137 'description' => ts('FK to Contact ID'),
138 'where' => 'civicrm_openid.contact_id',
139 'table_name' => 'civicrm_openid',
140 'entity' => 'OpenID',
141 'bao' => 'CRM_Core_BAO_OpenID',
143 'FKClassName' => 'CRM_Contact_DAO_Contact',
145 'label' => ts("Contact"),
149 'location_type_id' => [
150 'name' => 'location_type_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('OpenID Location Type'),
153 'description' => ts('Which Location does this email belong to.'),
154 'where' => 'civicrm_openid.location_type_id',
155 'table_name' => 'civicrm_openid',
156 'entity' => 'OpenID',
157 'bao' => 'CRM_Core_BAO_OpenID',
159 'pseudoconstant' => [
160 'table' => 'civicrm_location_type',
162 'labelColumn' => 'display_name',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('OpenID'),
170 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
172 'size' => CRM_Utils_Type
::HUGE
,
174 'where' => 'civicrm_openid.openid',
175 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
176 'dataPattern' => '/^[\w\/\:\.]+$/',
179 'table_name' => 'civicrm_openid',
180 'entity' => 'OpenID',
181 'bao' => 'CRM_Core_BAO_OpenID',
185 'allowed_to_login' => [
186 'name' => 'allowed_to_login',
187 'type' => CRM_Utils_Type
::T_BOOLEAN
,
188 'title' => ts('Allowed to login?'),
189 'description' => ts('Whether or not this user is allowed to login'),
191 'where' => 'civicrm_openid.allowed_to_login',
193 'table_name' => 'civicrm_openid',
194 'entity' => 'OpenID',
195 'bao' => 'CRM_Core_BAO_OpenID',
200 'name' => 'is_primary',
201 'type' => CRM_Utils_Type
::T_BOOLEAN
,
202 'title' => ts('Primary ID'),
203 'description' => ts('Is this the primary email for this contact and location.'),
204 'where' => 'civicrm_openid.is_primary',
206 'table_name' => 'civicrm_openid',
207 'entity' => 'OpenID',
208 'bao' => 'CRM_Core_BAO_OpenID',
216 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
218 return Civi
::$statics[__CLASS__
]['fields'];
222 * Return a mapping from field-name to the corresponding key (as used in fields()).
225 * Array(string $name => string $uniqueName).
227 public static function &fieldKeys() {
228 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
229 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
231 return Civi
::$statics[__CLASS__
]['fieldKeys'];
235 * Returns the names of this table
239 public static function getTableName() {
240 return self
::$_tableName;
244 * Returns if this table needs to be logged
248 public function getLog() {
253 * Returns the list of fields that can be imported
255 * @param bool $prefix
259 public static function &import($prefix = FALSE) {
260 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, []);
265 * Returns the list of fields that can be exported
267 * @param bool $prefix
271 public static function &export($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, []);
277 * Returns the list of indices
279 * @param bool $localize
283 public static function indices($localize = TRUE) {
285 'index_location_type' => [
286 'name' => 'index_location_type',
288 0 => 'location_type_id',
290 'localizable' => FALSE,
291 'sig' => 'civicrm_openid::0::location_type_id',
294 'name' => 'UI_openid',
298 'localizable' => FALSE,
300 'sig' => 'civicrm_openid::1::openid',
303 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;