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:7c70e03ffe06633c9e61c5845967d286)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
45 * @var int|string|null
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
52 * Which Location does this email belong to.
54 * @var int|string|null
55 * (SQL type: int unsigned)
56 * Note that values will be retrieved from the database as a string.
58 public $location_type_id;
61 * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
64 * (SQL type: varchar(255))
65 * Note that values will be retrieved from the database as a string.
70 * Whether or not this user is allowed to login
74 * Note that values will be retrieved from the database as a string.
76 public $allowed_to_login;
79 * Is this the primary email for this contact and location.
83 * Note that values will be retrieved from the database as a string.
90 public function __construct() {
91 $this->__table
= 'civicrm_openid';
92 parent
::__construct();
96 * Returns localized title of this entity.
99 * Whether to return the plural version of the title.
101 public static function getEntityTitle($plural = FALSE) {
102 return $plural ?
ts('Open IDs') : ts('Open ID');
106 * Returns foreign keys and entity references.
109 * [CRM_Core_Reference_Interface]
111 public static function getReferenceColumns() {
112 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
113 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
114 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
115 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
117 return Civi
::$statics[__CLASS__
]['links'];
121 * Returns all the column names of this table
125 public static function &fields() {
126 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
127 Civi
::$statics[__CLASS__
]['fields'] = [
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Open ID identifier'),
132 'description' => ts('Unique OpenID ID'),
134 'where' => 'civicrm_openid.id',
135 'table_name' => 'civicrm_openid',
136 'entity' => 'OpenID',
137 'bao' => 'CRM_Core_BAO_OpenID',
146 'name' => 'contact_id',
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Contact ID'),
149 'description' => ts('FK to Contact ID'),
150 'where' => 'civicrm_openid.contact_id',
151 'table_name' => 'civicrm_openid',
152 'entity' => 'OpenID',
153 'bao' => 'CRM_Core_BAO_OpenID',
155 'FKClassName' => 'CRM_Contact_DAO_Contact',
157 'label' => ts("Contact"),
161 'location_type_id' => [
162 'name' => 'location_type_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('OpenID Location Type'),
165 'description' => ts('Which Location does this email belong to.'),
166 'where' => 'civicrm_openid.location_type_id',
167 'table_name' => 'civicrm_openid',
168 'entity' => 'OpenID',
169 'bao' => 'CRM_Core_BAO_OpenID',
171 'pseudoconstant' => [
172 'table' => 'civicrm_location_type',
174 'labelColumn' => 'display_name',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('OpenID'),
182 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
184 'size' => CRM_Utils_Type
::HUGE
,
186 'where' => 'civicrm_openid.openid',
187 'headerPattern' => '/^Open.?ID|u(niq\w*)?.?ID/i',
188 'dataPattern' => '/^[\w\/\:\.]+$/',
191 'table_name' => 'civicrm_openid',
192 'entity' => 'OpenID',
193 'bao' => 'CRM_Core_BAO_OpenID',
197 'allowed_to_login' => [
198 'name' => 'allowed_to_login',
199 'type' => CRM_Utils_Type
::T_BOOLEAN
,
200 'title' => ts('Allowed to login?'),
201 'description' => ts('Whether or not this user is allowed to login'),
203 'where' => 'civicrm_openid.allowed_to_login',
205 'table_name' => 'civicrm_openid',
206 'entity' => 'OpenID',
207 'bao' => 'CRM_Core_BAO_OpenID',
212 'name' => 'is_primary',
213 'type' => CRM_Utils_Type
::T_BOOLEAN
,
214 'title' => ts('Primary ID'),
215 'description' => ts('Is this the primary email for this contact and location.'),
217 'where' => 'civicrm_openid.is_primary',
219 'table_name' => 'civicrm_openid',
220 'entity' => 'OpenID',
221 'bao' => 'CRM_Core_BAO_OpenID',
229 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
231 return Civi
::$statics[__CLASS__
]['fields'];
235 * Return a mapping from field-name to the corresponding key (as used in fields()).
238 * Array(string $name => string $uniqueName).
240 public static function &fieldKeys() {
241 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
242 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
244 return Civi
::$statics[__CLASS__
]['fieldKeys'];
248 * Returns the names of this table
252 public static function getTableName() {
253 return self
::$_tableName;
257 * Returns if this table needs to be logged
261 public function getLog() {
266 * Returns the list of fields that can be imported
268 * @param bool $prefix
272 public static function &import($prefix = FALSE) {
273 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'openid', $prefix, []);
278 * Returns the list of fields that can be exported
280 * @param bool $prefix
284 public static function &export($prefix = FALSE) {
285 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'openid', $prefix, []);
290 * Returns the list of indices
292 * @param bool $localize
296 public static function indices($localize = TRUE) {
298 'index_location_type' => [
299 'name' => 'index_location_type',
301 0 => 'location_type_id',
303 'localizable' => FALSE,
304 'sig' => 'civicrm_openid::0::location_type_id',
307 'name' => 'UI_openid',
311 'localizable' => FALSE,
313 'sig' => 'civicrm_openid::1::openid',
316 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;