| 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/Contribute/Widget.xml |
| 32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen |
| 33 | * (GenCodeChecksum:0c274425d81e53c5a1f1a4f4e3078ce3) |
| 34 | */ |
| 35 | require_once 'CRM/Core/DAO.php'; |
| 36 | require_once 'CRM/Utils/Type.php'; |
| 37 | class CRM_Contribute_DAO_Widget extends CRM_Core_DAO { |
| 38 | /** |
| 39 | * static instance to hold the table name |
| 40 | * |
| 41 | * @var string |
| 42 | */ |
| 43 | static $_tableName = 'civicrm_contribution_widget'; |
| 44 | /** |
| 45 | * static value to see if we should log any modifications to |
| 46 | * this table in the civicrm_log table |
| 47 | * |
| 48 | * @var boolean |
| 49 | */ |
| 50 | static $_log = true; |
| 51 | /** |
| 52 | * Contribution Id |
| 53 | * |
| 54 | * @var int unsigned |
| 55 | */ |
| 56 | public $id; |
| 57 | /** |
| 58 | * The Contribution Page which triggered this contribution |
| 59 | * |
| 60 | * @var int unsigned |
| 61 | */ |
| 62 | public $contribution_page_id; |
| 63 | /** |
| 64 | * Is this property active? |
| 65 | * |
| 66 | * @var boolean |
| 67 | */ |
| 68 | public $is_active; |
| 69 | /** |
| 70 | * Widget title. |
| 71 | * |
| 72 | * @var string |
| 73 | */ |
| 74 | public $title; |
| 75 | /** |
| 76 | * URL to Widget logo |
| 77 | * |
| 78 | * @var string |
| 79 | */ |
| 80 | public $url_logo; |
| 81 | /** |
| 82 | * Button title. |
| 83 | * |
| 84 | * @var string |
| 85 | */ |
| 86 | public $button_title; |
| 87 | /** |
| 88 | * About description. |
| 89 | * |
| 90 | * @var text |
| 91 | */ |
| 92 | public $about; |
| 93 | /** |
| 94 | * URL to Homepage. |
| 95 | * |
| 96 | * @var string |
| 97 | */ |
| 98 | public $url_homepage; |
| 99 | /** |
| 100 | * |
| 101 | * @var string |
| 102 | */ |
| 103 | public $color_title; |
| 104 | /** |
| 105 | * |
| 106 | * @var string |
| 107 | */ |
| 108 | public $color_button; |
| 109 | /** |
| 110 | * |
| 111 | * @var string |
| 112 | */ |
| 113 | public $color_bar; |
| 114 | /** |
| 115 | * |
| 116 | * @var string |
| 117 | */ |
| 118 | public $color_main_text; |
| 119 | /** |
| 120 | * |
| 121 | * @var string |
| 122 | */ |
| 123 | public $color_main; |
| 124 | /** |
| 125 | * |
| 126 | * @var string |
| 127 | */ |
| 128 | public $color_main_bg; |
| 129 | /** |
| 130 | * |
| 131 | * @var string |
| 132 | */ |
| 133 | public $color_bg; |
| 134 | /** |
| 135 | * |
| 136 | * @var string |
| 137 | */ |
| 138 | public $color_about_link; |
| 139 | /** |
| 140 | * |
| 141 | * @var string |
| 142 | */ |
| 143 | public $color_homepage_link; |
| 144 | /** |
| 145 | * class constructor |
| 146 | * |
| 147 | * @return civicrm_contribution_widget |
| 148 | */ |
| 149 | function __construct() { |
| 150 | $this->__table = 'civicrm_contribution_widget'; |
| 151 | parent::__construct(); |
| 152 | } |
| 153 | /** |
| 154 | * Returns foreign keys and entity references |
| 155 | * |
| 156 | * @return array |
| 157 | * [CRM_Core_Reference_Interface] |
| 158 | */ |
| 159 | static function getReferenceColumns() { |
| 160 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
| 161 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); |
| 162 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); |
| 163 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
| 164 | } |
| 165 | return Civi::$statics[__CLASS__]['links']; |
| 166 | } |
| 167 | /** |
| 168 | * Returns all the column names of this table |
| 169 | * |
| 170 | * @return array |
| 171 | */ |
| 172 | static function &fields() { |
| 173 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
| 174 | Civi::$statics[__CLASS__]['fields'] = array( |
| 175 | 'id' => array( |
| 176 | 'name' => 'id', |
| 177 | 'type' => CRM_Utils_Type::T_INT, |
| 178 | 'title' => ts('Widget ID') , |
| 179 | 'description' => 'Contribution Id', |
| 180 | 'required' => true, |
| 181 | ) , |
| 182 | 'contribution_page_id' => array( |
| 183 | 'name' => 'contribution_page_id', |
| 184 | 'type' => CRM_Utils_Type::T_INT, |
| 185 | 'title' => ts('Contribution Page') , |
| 186 | 'description' => 'The Contribution Page which triggered this contribution', |
| 187 | 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage', |
| 188 | ) , |
| 189 | 'is_active' => array( |
| 190 | 'name' => 'is_active', |
| 191 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 192 | 'title' => ts('Enabled?') , |
| 193 | 'description' => 'Is this property active?', |
| 194 | ) , |
| 195 | 'title' => array( |
| 196 | 'name' => 'title', |
| 197 | 'type' => CRM_Utils_Type::T_STRING, |
| 198 | 'title' => ts('Widget Title') , |
| 199 | 'description' => 'Widget title.', |
| 200 | 'maxlength' => 255, |
| 201 | 'size' => CRM_Utils_Type::HUGE, |
| 202 | ) , |
| 203 | 'url_logo' => array( |
| 204 | 'name' => 'url_logo', |
| 205 | 'type' => CRM_Utils_Type::T_STRING, |
| 206 | 'title' => ts('Widget Image Url') , |
| 207 | 'description' => 'URL to Widget logo', |
| 208 | 'maxlength' => 255, |
| 209 | 'size' => CRM_Utils_Type::HUGE, |
| 210 | ) , |
| 211 | 'button_title' => array( |
| 212 | 'name' => 'button_title', |
| 213 | 'type' => CRM_Utils_Type::T_STRING, |
| 214 | 'title' => ts('Button Title') , |
| 215 | 'description' => 'Button title.', |
| 216 | 'maxlength' => 255, |
| 217 | 'size' => CRM_Utils_Type::HUGE, |
| 218 | ) , |
| 219 | 'about' => array( |
| 220 | 'name' => 'about', |
| 221 | 'type' => CRM_Utils_Type::T_TEXT, |
| 222 | 'title' => ts('Description') , |
| 223 | 'description' => 'About description.', |
| 224 | ) , |
| 225 | 'url_homepage' => array( |
| 226 | 'name' => 'url_homepage', |
| 227 | 'type' => CRM_Utils_Type::T_STRING, |
| 228 | 'title' => ts('Homepage Url') , |
| 229 | 'description' => 'URL to Homepage.', |
| 230 | 'maxlength' => 255, |
| 231 | 'size' => CRM_Utils_Type::HUGE, |
| 232 | ) , |
| 233 | 'color_title' => array( |
| 234 | 'name' => 'color_title', |
| 235 | 'type' => CRM_Utils_Type::T_STRING, |
| 236 | 'title' => ts('Title Color') , |
| 237 | 'maxlength' => 10, |
| 238 | 'size' => CRM_Utils_Type::TWELVE, |
| 239 | ) , |
| 240 | 'color_button' => array( |
| 241 | 'name' => 'color_button', |
| 242 | 'type' => CRM_Utils_Type::T_STRING, |
| 243 | 'title' => ts('Button Colour') , |
| 244 | 'maxlength' => 10, |
| 245 | 'size' => CRM_Utils_Type::TWELVE, |
| 246 | ) , |
| 247 | 'color_bar' => array( |
| 248 | 'name' => 'color_bar', |
| 249 | 'type' => CRM_Utils_Type::T_STRING, |
| 250 | 'title' => ts('Bar Color') , |
| 251 | 'maxlength' => 10, |
| 252 | 'size' => CRM_Utils_Type::TWELVE, |
| 253 | ) , |
| 254 | 'color_main_text' => array( |
| 255 | 'name' => 'color_main_text', |
| 256 | 'type' => CRM_Utils_Type::T_STRING, |
| 257 | 'title' => ts('Main Text Color') , |
| 258 | 'maxlength' => 10, |
| 259 | 'size' => CRM_Utils_Type::TWELVE, |
| 260 | ) , |
| 261 | 'color_main' => array( |
| 262 | 'name' => 'color_main', |
| 263 | 'type' => CRM_Utils_Type::T_STRING, |
| 264 | 'title' => ts('Main Colour') , |
| 265 | 'maxlength' => 10, |
| 266 | 'size' => CRM_Utils_Type::TWELVE, |
| 267 | ) , |
| 268 | 'color_main_bg' => array( |
| 269 | 'name' => 'color_main_bg', |
| 270 | 'type' => CRM_Utils_Type::T_STRING, |
| 271 | 'title' => ts('Backgroup Color') , |
| 272 | 'maxlength' => 10, |
| 273 | 'size' => CRM_Utils_Type::TWELVE, |
| 274 | ) , |
| 275 | 'color_bg' => array( |
| 276 | 'name' => 'color_bg', |
| 277 | 'type' => CRM_Utils_Type::T_STRING, |
| 278 | 'title' => ts('Other Backgroun Colour') , |
| 279 | 'maxlength' => 10, |
| 280 | 'size' => CRM_Utils_Type::TWELVE, |
| 281 | ) , |
| 282 | 'color_about_link' => array( |
| 283 | 'name' => 'color_about_link', |
| 284 | 'type' => CRM_Utils_Type::T_STRING, |
| 285 | 'title' => ts('About Link Colour') , |
| 286 | 'maxlength' => 10, |
| 287 | 'size' => CRM_Utils_Type::TWELVE, |
| 288 | ) , |
| 289 | 'color_homepage_link' => array( |
| 290 | 'name' => 'color_homepage_link', |
| 291 | 'type' => CRM_Utils_Type::T_STRING, |
| 292 | 'title' => ts('Homepage Link Colour') , |
| 293 | 'maxlength' => 10, |
| 294 | 'size' => CRM_Utils_Type::TWELVE, |
| 295 | ) , |
| 296 | ); |
| 297 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
| 298 | } |
| 299 | return Civi::$statics[__CLASS__]['fields']; |
| 300 | } |
| 301 | /** |
| 302 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
| 303 | * |
| 304 | * @return array |
| 305 | * Array(string $name => string $uniqueName). |
| 306 | */ |
| 307 | static function &fieldKeys() { |
| 308 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
| 309 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); |
| 310 | } |
| 311 | return Civi::$statics[__CLASS__]['fieldKeys']; |
| 312 | } |
| 313 | /** |
| 314 | * Returns the names of this table |
| 315 | * |
| 316 | * @return string |
| 317 | */ |
| 318 | static function getTableName() { |
| 319 | return self::$_tableName; |
| 320 | } |
| 321 | /** |
| 322 | * Returns if this table needs to be logged |
| 323 | * |
| 324 | * @return boolean |
| 325 | */ |
| 326 | function getLog() { |
| 327 | return self::$_log; |
| 328 | } |
| 329 | /** |
| 330 | * Returns the list of fields that can be imported |
| 331 | * |
| 332 | * @param bool $prefix |
| 333 | * |
| 334 | * @return array |
| 335 | */ |
| 336 | static function &import($prefix = false) { |
| 337 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, array()); |
| 338 | return $r; |
| 339 | } |
| 340 | /** |
| 341 | * Returns the list of fields that can be exported |
| 342 | * |
| 343 | * @param bool $prefix |
| 344 | * |
| 345 | * @return array |
| 346 | */ |
| 347 | static function &export($prefix = false) { |
| 348 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, array()); |
| 349 | return $r; |
| 350 | } |
| 351 | } |