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:1d9c6cf4e3d809a3b3f5963ccb189e83)
13 * Database access object for the Website entity.
15 class CRM_Core_DAO_Website
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_website';
27 * Icon associated with this entity.
31 public static $_icon = 'fa-desktop';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = FALSE;
62 * Which Website type does this website belong to.
66 public $website_type_id;
71 public function __construct() {
72 $this->__table
= 'civicrm_website';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Websites') : ts('Website');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Website ID'),
113 'description' => ts('Unique Website ID'),
115 'where' => 'civicrm_website.id',
116 'table_name' => 'civicrm_website',
117 'entity' => 'Website',
118 'bao' => 'CRM_Core_BAO_Website',
123 'name' => 'contact_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Contact'),
126 'description' => ts('FK to Contact ID'),
127 'where' => 'civicrm_website.contact_id',
128 'table_name' => 'civicrm_website',
129 'entity' => 'Website',
130 'bao' => 'CRM_Core_BAO_Website',
132 'FKClassName' => 'CRM_Contact_DAO_Contact',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Website'),
139 'description' => ts('Website'),
143 'where' => 'civicrm_website.url',
144 'headerPattern' => '/Website/i',
145 'dataPattern' => '/^[A-Za-z][0-9A-Za-z]{20,}$/',
147 'table_name' => 'civicrm_website',
148 'entity' => 'Website',
149 'bao' => 'CRM_Core_BAO_Website',
156 'website_type_id' => [
157 'name' => 'website_type_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Website Type'),
160 'description' => ts('Which Website type does this website belong to.'),
161 'where' => 'civicrm_website.website_type_id',
162 'table_name' => 'civicrm_website',
163 'entity' => 'Website',
164 'bao' => 'CRM_Core_BAO_Website',
169 'pseudoconstant' => [
170 'optionGroupName' => 'website_type',
171 'optionEditPath' => 'civicrm/admin/options/website_type',
176 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
178 return Civi
::$statics[__CLASS__
]['fields'];
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
185 * Array(string $name => string $uniqueName).
187 public static function &fieldKeys() {
188 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
189 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
191 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 public static function getTableName() {
200 return self
::$_tableName;
204 * Returns if this table needs to be logged
208 public function getLog() {
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'website', $prefix, []);
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'website', $prefix, []);
237 * Returns the list of indices
239 * @param bool $localize
243 public static function indices($localize = TRUE) {
245 'UI_website_type_id' => [
246 'name' => 'UI_website_type_id',
248 0 => 'website_type_id',
250 'localizable' => FALSE,
251 'sig' => 'civicrm_website::0::website_type_id',
254 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;