5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/Website.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:7f68af3a95bfdc5dc7421efef27c0511)
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 static $_tableName = 'civicrm_website';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Unique Website ID',
96 'table_name' => 'civicrm_website',
97 'entity' => 'Website',
98 'bao' => 'CRM_Core_BAO_Website',
102 'name' => 'contact_id',
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Contact'),
105 'description' => 'FK to Contact ID',
106 'table_name' => 'civicrm_website',
107 'entity' => 'Website',
108 'bao' => 'CRM_Core_BAO_Website',
110 'FKClassName' => 'CRM_Contact_DAO_Contact',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Website'),
116 'description' => 'Website',
120 'where' => 'civicrm_website.url',
121 'headerPattern' => '/Website/i',
122 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
124 'table_name' => 'civicrm_website',
125 'entity' => 'Website',
126 'bao' => 'CRM_Core_BAO_Website',
132 'website_type_id' => [
133 'name' => 'website_type_id',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Website Type'),
136 'description' => 'Which Website type does this website belong to.',
137 'table_name' => 'civicrm_website',
138 'entity' => 'Website',
139 'bao' => 'CRM_Core_BAO_Website',
144 'pseudoconstant' => [
145 'optionGroupName' => 'website_type',
146 'optionEditPath' => 'civicrm/admin/options/website_type',
150 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
152 return Civi
::$statics[__CLASS__
]['fields'];
156 * Return a mapping from field-name to the corresponding key (as used in fields()).
159 * Array(string $name => string $uniqueName).
161 public static function &fieldKeys() {
162 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
163 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
165 return Civi
::$statics[__CLASS__
]['fieldKeys'];
169 * Returns the names of this table
173 public static function getTableName() {
174 return self
::$_tableName;
178 * Returns if this table needs to be logged
182 public function getLog() {
187 * Returns the list of fields that can be imported
189 * @param bool $prefix
193 public static function &import($prefix = FALSE) {
194 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'website', $prefix, []);
199 * Returns the list of fields that can be exported
201 * @param bool $prefix
205 public static function &export($prefix = FALSE) {
206 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'website', $prefix, []);
211 * Returns the list of indices
213 * @param bool $localize
217 public static function indices($localize = TRUE) {
219 'UI_website_type_id' => [
220 'name' => 'UI_website_type_id',
222 0 => 'website_type_id',
224 'localizable' => FALSE,
225 'sig' => 'civicrm_website::0::website_type_id',
228 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;