5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Website.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2b048fb746a5762a6e132fe7b1e8dd07)
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 * Icon associated with this entity.
29 public static $_icon = 'fa-desktop';
32 * Should CiviCRM log any modifications to this table in the civicrm_log table.
36 public static $_log = FALSE;
60 * Which Website type does this website belong to.
64 public $website_type_id;
69 public function __construct() {
70 $this->__table
= 'civicrm_website';
71 parent
::__construct();
75 * Returns localized title of this entity.
77 public static function getEntityTitle() {
78 return ts('Websites');
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('Website ID'),
108 'description' => ts('Unique Website ID'),
110 'where' => 'civicrm_website.id',
111 'table_name' => 'civicrm_website',
112 'entity' => 'Website',
113 'bao' => 'CRM_Core_BAO_Website',
118 'name' => 'contact_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Contact'),
121 'description' => ts('FK to Contact ID'),
122 'where' => 'civicrm_website.contact_id',
123 'table_name' => 'civicrm_website',
124 'entity' => 'Website',
125 'bao' => 'CRM_Core_BAO_Website',
127 'FKClassName' => 'CRM_Contact_DAO_Contact',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Website'),
134 'description' => ts('Website'),
138 'where' => 'civicrm_website.url',
139 'headerPattern' => '/Website/i',
140 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
142 'table_name' => 'civicrm_website',
143 'entity' => 'Website',
144 'bao' => 'CRM_Core_BAO_Website',
151 'website_type_id' => [
152 'name' => 'website_type_id',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('Website Type'),
155 'description' => ts('Which Website type does this website belong to.'),
156 'where' => 'civicrm_website.website_type_id',
157 'table_name' => 'civicrm_website',
158 'entity' => 'Website',
159 'bao' => 'CRM_Core_BAO_Website',
164 'pseudoconstant' => [
165 'optionGroupName' => 'website_type',
166 'optionEditPath' => 'civicrm/admin/options/website_type',
171 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
173 return Civi
::$statics[__CLASS__
]['fields'];
177 * Return a mapping from field-name to the corresponding key (as used in fields()).
180 * Array(string $name => string $uniqueName).
182 public static function &fieldKeys() {
183 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
184 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
186 return Civi
::$statics[__CLASS__
]['fieldKeys'];
190 * Returns the names of this table
194 public static function getTableName() {
195 return self
::$_tableName;
199 * Returns if this table needs to be logged
203 public function getLog() {
208 * Returns the list of fields that can be imported
210 * @param bool $prefix
214 public static function &import($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'website', $prefix, []);
220 * Returns the list of fields that can be exported
222 * @param bool $prefix
226 public static function &export($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'website', $prefix, []);
232 * Returns the list of indices
234 * @param bool $localize
238 public static function indices($localize = TRUE) {
240 'UI_website_type_id' => [
241 'name' => 'UI_website_type_id',
243 0 => 'website_type_id',
245 'localizable' => FALSE,
246 'sig' => 'civicrm_website::0::website_type_id',
249 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;