5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Website.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:22c11a2bc194d075912df3279acc6a97)
13 * Database access object for the Website entity.
15 class CRM_Core_DAO_Website
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_website';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
53 * Which Website type does this website belong to.
57 public $website_type_id;
62 public function __construct() {
63 $this->__table
= 'civicrm_website';
64 parent
::__construct();
68 * Returns foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
77 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
79 return Civi
::$statics[__CLASS__
]['links'];
83 * Returns all the column names of this table
87 public static function &fields() {
88 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
89 Civi
::$statics[__CLASS__
]['fields'] = [
92 'type' => CRM_Utils_Type
::T_INT
,
93 'title' => ts('Website ID'),
94 'description' => ts('Unique Website ID'),
96 'where' => 'civicrm_website.id',
97 'table_name' => 'civicrm_website',
98 'entity' => 'Website',
99 'bao' => 'CRM_Core_BAO_Website',
103 'name' => 'contact_id',
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Contact'),
106 'description' => ts('FK to Contact ID'),
107 'where' => 'civicrm_website.contact_id',
108 'table_name' => 'civicrm_website',
109 'entity' => 'Website',
110 'bao' => 'CRM_Core_BAO_Website',
112 'FKClassName' => 'CRM_Contact_DAO_Contact',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Website'),
118 'description' => ts('Website'),
122 'where' => 'civicrm_website.url',
123 'headerPattern' => '/Website/i',
124 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
126 'table_name' => 'civicrm_website',
127 'entity' => 'Website',
128 'bao' => 'CRM_Core_BAO_Website',
134 'website_type_id' => [
135 'name' => 'website_type_id',
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Website Type'),
138 'description' => ts('Which Website type does this website belong to.'),
139 'where' => 'civicrm_website.website_type_id',
140 'table_name' => 'civicrm_website',
141 'entity' => 'Website',
142 'bao' => 'CRM_Core_BAO_Website',
147 'pseudoconstant' => [
148 'optionGroupName' => 'website_type',
149 'optionEditPath' => 'civicrm/admin/options/website_type',
153 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
155 return Civi
::$statics[__CLASS__
]['fields'];
159 * Return a mapping from field-name to the corresponding key (as used in fields()).
162 * Array(string $name => string $uniqueName).
164 public static function &fieldKeys() {
165 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
166 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
168 return Civi
::$statics[__CLASS__
]['fieldKeys'];
172 * Returns the names of this table
176 public static function getTableName() {
177 return self
::$_tableName;
181 * Returns if this table needs to be logged
185 public function getLog() {
190 * Returns the list of fields that can be imported
192 * @param bool $prefix
196 public static function &import($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'website', $prefix, []);
202 * Returns the list of fields that can be exported
204 * @param bool $prefix
208 public static function &export($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'website', $prefix, []);
214 * Returns the list of indices
216 * @param bool $localize
220 public static function indices($localize = TRUE) {
222 'UI_website_type_id' => [
223 'name' => 'UI_website_type_id',
225 0 => 'website_type_id',
227 'localizable' => FALSE,
228 'sig' => 'civicrm_website::0::website_type_id',
231 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;