| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | CiviCRM version 4.7 | |
| 5 | +--------------------------------------------------------------------+ |
| 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
| 7 | +--------------------------------------------------------------------+ |
| 8 | | This file is a part of CiviCRM. | |
| 9 | | | |
| 10 | | CiviCRM is free software; you can copy, modify, and distribute it | |
| 11 | | under the terms of the GNU Affero General Public License | |
| 12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
| 13 | | | |
| 14 | | CiviCRM is distributed in the hope that it will be useful, but | |
| 15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 17 | | See the GNU Affero General Public License for more details. | |
| 18 | | | |
| 19 | | You should have received a copy of the GNU Affero General Public | |
| 20 | | License and the CiviCRM Licensing Exception along | |
| 21 | | with this program; if not, contact CiviCRM LLC | |
| 22 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
| 23 | | GNU Affero General Public License or the licensing of CiviCRM, | |
| 24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
| 25 | +--------------------------------------------------------------------+ |
| 26 | */ |
| 27 | /** |
| 28 | * @package CRM |
| 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
| 30 | * |
| 31 | * Generated from xml/schema/CRM/Core/Dashboard.xml |
| 32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen |
| 33 | * (GenCodeChecksum:6b7454609bac684a5d32597cdd433f3d) |
| 34 | */ |
| 35 | require_once 'CRM/Core/DAO.php'; |
| 36 | require_once 'CRM/Utils/Type.php'; |
| 37 | /** |
| 38 | * CRM_Core_DAO_Dashboard constructor. |
| 39 | */ |
| 40 | class CRM_Core_DAO_Dashboard extends CRM_Core_DAO { |
| 41 | /** |
| 42 | * Static instance to hold the table name. |
| 43 | * |
| 44 | * @var string |
| 45 | */ |
| 46 | static $_tableName = 'civicrm_dashboard'; |
| 47 | /** |
| 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
| 49 | * |
| 50 | * @var boolean |
| 51 | */ |
| 52 | static $_log = false; |
| 53 | /** |
| 54 | * |
| 55 | * @var int unsigned |
| 56 | */ |
| 57 | public $id; |
| 58 | /** |
| 59 | * Domain for dashboard |
| 60 | * |
| 61 | * @var int unsigned |
| 62 | */ |
| 63 | public $domain_id; |
| 64 | /** |
| 65 | * Internal name of dashlet. |
| 66 | * |
| 67 | * @var string |
| 68 | */ |
| 69 | public $name; |
| 70 | /** |
| 71 | * dashlet title |
| 72 | * |
| 73 | * @var string |
| 74 | */ |
| 75 | public $label; |
| 76 | /** |
| 77 | * url in case of external dashlet |
| 78 | * |
| 79 | * @var string |
| 80 | */ |
| 81 | public $url; |
| 82 | /** |
| 83 | * Permission for the dashlet |
| 84 | * |
| 85 | * @var string |
| 86 | */ |
| 87 | public $permission; |
| 88 | /** |
| 89 | * Permission Operator |
| 90 | * |
| 91 | * @var string |
| 92 | */ |
| 93 | public $permission_operator; |
| 94 | /** |
| 95 | * fullscreen url for dashlet |
| 96 | * |
| 97 | * @var string |
| 98 | */ |
| 99 | public $fullscreen_url; |
| 100 | /** |
| 101 | * Is this dashlet active? |
| 102 | * |
| 103 | * @var boolean |
| 104 | */ |
| 105 | public $is_active; |
| 106 | /** |
| 107 | * Is this dashlet reserved? |
| 108 | * |
| 109 | * @var boolean |
| 110 | */ |
| 111 | public $is_reserved; |
| 112 | /** |
| 113 | * Number of minutes to cache dashlet content in browser localStorage. |
| 114 | * |
| 115 | * @var int unsigned |
| 116 | */ |
| 117 | public $cache_minutes; |
| 118 | /** |
| 119 | * Class constructor. |
| 120 | */ |
| 121 | function __construct() { |
| 122 | $this->__table = 'civicrm_dashboard'; |
| 123 | parent::__construct(); |
| 124 | } |
| 125 | /** |
| 126 | * Returns foreign keys and entity references. |
| 127 | * |
| 128 | * @return array |
| 129 | * [CRM_Core_Reference_Interface] |
| 130 | */ |
| 131 | static function getReferenceColumns() { |
| 132 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
| 133 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); |
| 134 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); |
| 135 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
| 136 | } |
| 137 | return Civi::$statics[__CLASS__]['links']; |
| 138 | } |
| 139 | /** |
| 140 | * Returns all the column names of this table |
| 141 | * |
| 142 | * @return array |
| 143 | */ |
| 144 | static function &fields() { |
| 145 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
| 146 | Civi::$statics[__CLASS__]['fields'] = array( |
| 147 | 'id' => array( |
| 148 | 'name' => 'id', |
| 149 | 'type' => CRM_Utils_Type::T_INT, |
| 150 | 'title' => ts('DashletID') , |
| 151 | 'required' => true, |
| 152 | 'table_name' => 'civicrm_dashboard', |
| 153 | 'entity' => 'Dashboard', |
| 154 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 155 | 'localizable' => 0, |
| 156 | ) , |
| 157 | 'domain_id' => array( |
| 158 | 'name' => 'domain_id', |
| 159 | 'type' => CRM_Utils_Type::T_INT, |
| 160 | 'title' => ts('Dashlet Domain') , |
| 161 | 'description' => 'Domain for dashboard', |
| 162 | 'required' => true, |
| 163 | 'table_name' => 'civicrm_dashboard', |
| 164 | 'entity' => 'Dashboard', |
| 165 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 166 | 'localizable' => 0, |
| 167 | 'FKClassName' => 'CRM_Core_DAO_Domain', |
| 168 | 'pseudoconstant' => array( |
| 169 | 'table' => 'civicrm_domain', |
| 170 | 'keyColumn' => 'id', |
| 171 | 'labelColumn' => 'name', |
| 172 | ) |
| 173 | ) , |
| 174 | 'name' => array( |
| 175 | 'name' => 'name', |
| 176 | 'type' => CRM_Utils_Type::T_STRING, |
| 177 | 'title' => ts('Dashlet Name') , |
| 178 | 'description' => 'Internal name of dashlet.', |
| 179 | 'maxlength' => 64, |
| 180 | 'size' => CRM_Utils_Type::BIG, |
| 181 | 'table_name' => 'civicrm_dashboard', |
| 182 | 'entity' => 'Dashboard', |
| 183 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 184 | 'localizable' => 0, |
| 185 | ) , |
| 186 | 'label' => array( |
| 187 | 'name' => 'label', |
| 188 | 'type' => CRM_Utils_Type::T_STRING, |
| 189 | 'title' => ts('Dashlet Title') , |
| 190 | 'description' => 'dashlet title', |
| 191 | 'maxlength' => 255, |
| 192 | 'size' => CRM_Utils_Type::HUGE, |
| 193 | 'table_name' => 'civicrm_dashboard', |
| 194 | 'entity' => 'Dashboard', |
| 195 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 196 | 'localizable' => 1, |
| 197 | ) , |
| 198 | 'url' => array( |
| 199 | 'name' => 'url', |
| 200 | 'type' => CRM_Utils_Type::T_STRING, |
| 201 | 'title' => ts('Dashlet URL') , |
| 202 | 'description' => 'url in case of external dashlet', |
| 203 | 'maxlength' => 255, |
| 204 | 'size' => CRM_Utils_Type::HUGE, |
| 205 | 'table_name' => 'civicrm_dashboard', |
| 206 | 'entity' => 'Dashboard', |
| 207 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 208 | 'localizable' => 0, |
| 209 | ) , |
| 210 | 'permission' => array( |
| 211 | 'name' => 'permission', |
| 212 | 'type' => CRM_Utils_Type::T_STRING, |
| 213 | 'title' => ts('Dashlet Permission') , |
| 214 | 'description' => 'Permission for the dashlet', |
| 215 | 'maxlength' => 255, |
| 216 | 'size' => CRM_Utils_Type::HUGE, |
| 217 | 'table_name' => 'civicrm_dashboard', |
| 218 | 'entity' => 'Dashboard', |
| 219 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 220 | 'localizable' => 0, |
| 221 | ) , |
| 222 | 'permission_operator' => array( |
| 223 | 'name' => 'permission_operator', |
| 224 | 'type' => CRM_Utils_Type::T_STRING, |
| 225 | 'title' => ts('Dashlet Permission Operator') , |
| 226 | 'description' => 'Permission Operator', |
| 227 | 'maxlength' => 3, |
| 228 | 'size' => CRM_Utils_Type::FOUR, |
| 229 | 'table_name' => 'civicrm_dashboard', |
| 230 | 'entity' => 'Dashboard', |
| 231 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 232 | 'localizable' => 0, |
| 233 | ) , |
| 234 | 'fullscreen_url' => array( |
| 235 | 'name' => 'fullscreen_url', |
| 236 | 'type' => CRM_Utils_Type::T_STRING, |
| 237 | 'title' => ts('Fullscreen URL') , |
| 238 | 'description' => 'fullscreen url for dashlet', |
| 239 | 'maxlength' => 255, |
| 240 | 'size' => CRM_Utils_Type::HUGE, |
| 241 | 'table_name' => 'civicrm_dashboard', |
| 242 | 'entity' => 'Dashboard', |
| 243 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 244 | 'localizable' => 0, |
| 245 | ) , |
| 246 | 'is_active' => array( |
| 247 | 'name' => 'is_active', |
| 248 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 249 | 'title' => ts('Is Dashlet Active?') , |
| 250 | 'description' => 'Is this dashlet active?', |
| 251 | 'table_name' => 'civicrm_dashboard', |
| 252 | 'entity' => 'Dashboard', |
| 253 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 254 | 'localizable' => 0, |
| 255 | ) , |
| 256 | 'is_reserved' => array( |
| 257 | 'name' => 'is_reserved', |
| 258 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 259 | 'title' => ts('Is Dashlet Reserved?') , |
| 260 | 'description' => 'Is this dashlet reserved?', |
| 261 | 'table_name' => 'civicrm_dashboard', |
| 262 | 'entity' => 'Dashboard', |
| 263 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 264 | 'localizable' => 0, |
| 265 | ) , |
| 266 | 'cache_minutes' => array( |
| 267 | 'name' => 'cache_minutes', |
| 268 | 'type' => CRM_Utils_Type::T_INT, |
| 269 | 'title' => ts('Cache Minutes') , |
| 270 | 'description' => 'Number of minutes to cache dashlet content in browser localStorage.', |
| 271 | 'required' => true, |
| 272 | 'default' => '60', |
| 273 | 'table_name' => 'civicrm_dashboard', |
| 274 | 'entity' => 'Dashboard', |
| 275 | 'bao' => 'CRM_Core_BAO_Dashboard', |
| 276 | 'localizable' => 0, |
| 277 | ) , |
| 278 | ); |
| 279 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
| 280 | } |
| 281 | return Civi::$statics[__CLASS__]['fields']; |
| 282 | } |
| 283 | /** |
| 284 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
| 285 | * |
| 286 | * @return array |
| 287 | * Array(string $name => string $uniqueName). |
| 288 | */ |
| 289 | static function &fieldKeys() { |
| 290 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
| 291 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); |
| 292 | } |
| 293 | return Civi::$statics[__CLASS__]['fieldKeys']; |
| 294 | } |
| 295 | /** |
| 296 | * Returns the names of this table |
| 297 | * |
| 298 | * @return string |
| 299 | */ |
| 300 | static function getTableName() { |
| 301 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
| 302 | } |
| 303 | /** |
| 304 | * Returns if this table needs to be logged |
| 305 | * |
| 306 | * @return boolean |
| 307 | */ |
| 308 | function getLog() { |
| 309 | return self::$_log; |
| 310 | } |
| 311 | /** |
| 312 | * Returns the list of fields that can be imported |
| 313 | * |
| 314 | * @param bool $prefix |
| 315 | * |
| 316 | * @return array |
| 317 | */ |
| 318 | static function &import($prefix = false) { |
| 319 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, array()); |
| 320 | return $r; |
| 321 | } |
| 322 | /** |
| 323 | * Returns the list of fields that can be exported |
| 324 | * |
| 325 | * @param bool $prefix |
| 326 | * |
| 327 | * @return array |
| 328 | */ |
| 329 | static function &export($prefix = false) { |
| 330 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, array()); |
| 331 | return $r; |
| 332 | } |
| 333 | } |