| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | CiviCRM version 4.7 | |
| 5 | +--------------------------------------------------------------------+ |
| 6 | | Copyright CiviCRM LLC (c) 2004-2016 | |
| 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-2016 |
| 30 | * |
| 31 | * Generated from xml/schema/CRM/Member/MembershipStatus.xml |
| 32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen |
| 33 | * (GenCodeChecksum:bdac419828ba2cd3b35ec8684e1e724b) |
| 34 | */ |
| 35 | require_once 'CRM/Core/DAO.php'; |
| 36 | require_once 'CRM/Utils/Type.php'; |
| 37 | class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO { |
| 38 | /** |
| 39 | * static instance to hold the table name |
| 40 | * |
| 41 | * @var string |
| 42 | */ |
| 43 | static $_tableName = 'civicrm_membership_status'; |
| 44 | /** |
| 45 | * static instance to hold the field values |
| 46 | * |
| 47 | * @var array |
| 48 | */ |
| 49 | static $_fields = null; |
| 50 | /** |
| 51 | * static instance to hold the keys used in $_fields for each field. |
| 52 | * |
| 53 | * @var array |
| 54 | */ |
| 55 | static $_fieldKeys = null; |
| 56 | /** |
| 57 | * static instance to hold the FK relationships |
| 58 | * |
| 59 | * @var string |
| 60 | */ |
| 61 | static $_links = null; |
| 62 | /** |
| 63 | * static instance to hold the values that can |
| 64 | * be imported |
| 65 | * |
| 66 | * @var array |
| 67 | */ |
| 68 | static $_import = null; |
| 69 | /** |
| 70 | * static instance to hold the values that can |
| 71 | * be exported |
| 72 | * |
| 73 | * @var array |
| 74 | */ |
| 75 | static $_export = null; |
| 76 | /** |
| 77 | * static value to see if we should log any modifications to |
| 78 | * this table in the civicrm_log table |
| 79 | * |
| 80 | * @var boolean |
| 81 | */ |
| 82 | static $_log = true; |
| 83 | /** |
| 84 | * Membership Id |
| 85 | * |
| 86 | * @var int unsigned |
| 87 | */ |
| 88 | public $id; |
| 89 | /** |
| 90 | * Name for Membership Status |
| 91 | * |
| 92 | * @var string |
| 93 | */ |
| 94 | public $name; |
| 95 | /** |
| 96 | * Label for Membership Status |
| 97 | * |
| 98 | * @var string |
| 99 | */ |
| 100 | public $label; |
| 101 | /** |
| 102 | * Event when this status starts. |
| 103 | * |
| 104 | * @var string |
| 105 | */ |
| 106 | public $start_event; |
| 107 | /** |
| 108 | * Unit used for adjusting from start_event. |
| 109 | * |
| 110 | * @var string |
| 111 | */ |
| 112 | public $start_event_adjust_unit; |
| 113 | /** |
| 114 | * Status range begins this many units from start_event. |
| 115 | * |
| 116 | * @var int |
| 117 | */ |
| 118 | public $start_event_adjust_interval; |
| 119 | /** |
| 120 | * Event after which this status ends. |
| 121 | * |
| 122 | * @var string |
| 123 | */ |
| 124 | public $end_event; |
| 125 | /** |
| 126 | * Unit used for adjusting from the ending event. |
| 127 | * |
| 128 | * @var string |
| 129 | */ |
| 130 | public $end_event_adjust_unit; |
| 131 | /** |
| 132 | * Status range ends this many units from end_event. |
| 133 | * |
| 134 | * @var int |
| 135 | */ |
| 136 | public $end_event_adjust_interval; |
| 137 | /** |
| 138 | * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE). |
| 139 | * |
| 140 | * @var boolean |
| 141 | */ |
| 142 | public $is_current_member; |
| 143 | /** |
| 144 | * Is this status for admin/manual assignment only. |
| 145 | * |
| 146 | * @var boolean |
| 147 | */ |
| 148 | public $is_admin; |
| 149 | /** |
| 150 | * |
| 151 | * @var int |
| 152 | */ |
| 153 | public $weight; |
| 154 | /** |
| 155 | * Assign this status to a membership record if no other status match is found. |
| 156 | * |
| 157 | * @var boolean |
| 158 | */ |
| 159 | public $is_default; |
| 160 | /** |
| 161 | * Is this membership_status enabled. |
| 162 | * |
| 163 | * @var boolean |
| 164 | */ |
| 165 | public $is_active; |
| 166 | /** |
| 167 | * Is this membership_status reserved. |
| 168 | * |
| 169 | * @var boolean |
| 170 | */ |
| 171 | public $is_reserved; |
| 172 | /** |
| 173 | * class constructor |
| 174 | * |
| 175 | * @return civicrm_membership_status |
| 176 | */ |
| 177 | function __construct() { |
| 178 | $this->__table = 'civicrm_membership_status'; |
| 179 | parent::__construct(); |
| 180 | } |
| 181 | /** |
| 182 | * Returns all the column names of this table |
| 183 | * |
| 184 | * @return array |
| 185 | */ |
| 186 | static function &fields() { |
| 187 | if (!(self::$_fields)) { |
| 188 | self::$_fields = array( |
| 189 | 'id' => array( |
| 190 | 'name' => 'id', |
| 191 | 'type' => CRM_Utils_Type::T_INT, |
| 192 | 'title' => ts('Membership Status ID') , |
| 193 | 'description' => 'Membership Id', |
| 194 | 'required' => true, |
| 195 | ) , |
| 196 | 'membership_status' => array( |
| 197 | 'name' => 'name', |
| 198 | 'type' => CRM_Utils_Type::T_STRING, |
| 199 | 'title' => ts('Membership Status') , |
| 200 | 'description' => 'Name for Membership Status', |
| 201 | 'maxlength' => 128, |
| 202 | 'size' => CRM_Utils_Type::HUGE, |
| 203 | 'import' => true, |
| 204 | 'where' => 'civicrm_membership_status.name', |
| 205 | 'headerPattern' => '', |
| 206 | 'dataPattern' => '', |
| 207 | 'export' => true, |
| 208 | ) , |
| 209 | 'label' => array( |
| 210 | 'name' => 'label', |
| 211 | 'type' => CRM_Utils_Type::T_STRING, |
| 212 | 'title' => ts('Label') , |
| 213 | 'description' => 'Label for Membership Status', |
| 214 | 'maxlength' => 128, |
| 215 | 'size' => CRM_Utils_Type::HUGE, |
| 216 | ) , |
| 217 | 'start_event' => array( |
| 218 | 'name' => 'start_event', |
| 219 | 'type' => CRM_Utils_Type::T_STRING, |
| 220 | 'title' => ts('Start Event') , |
| 221 | 'description' => 'Event when this status starts.', |
| 222 | 'maxlength' => 12, |
| 223 | 'size' => CRM_Utils_Type::TWELVE, |
| 224 | 'html' => array( |
| 225 | 'type' => 'Select', |
| 226 | ) , |
| 227 | 'pseudoconstant' => array( |
| 228 | 'callback' => 'CRM_Core_SelectValues::eventDate', |
| 229 | ) |
| 230 | ) , |
| 231 | 'start_event_adjust_unit' => array( |
| 232 | 'name' => 'start_event_adjust_unit', |
| 233 | 'type' => CRM_Utils_Type::T_STRING, |
| 234 | 'title' => ts('Start Event Adjust Unit') , |
| 235 | 'description' => 'Unit used for adjusting from start_event.', |
| 236 | 'maxlength' => 8, |
| 237 | 'size' => CRM_Utils_Type::EIGHT, |
| 238 | 'html' => array( |
| 239 | 'type' => 'Select', |
| 240 | ) , |
| 241 | 'pseudoconstant' => array( |
| 242 | 'callback' => 'CRM_Core_SelectValues::unitList', |
| 243 | ) |
| 244 | ) , |
| 245 | 'start_event_adjust_interval' => array( |
| 246 | 'name' => 'start_event_adjust_interval', |
| 247 | 'type' => CRM_Utils_Type::T_INT, |
| 248 | 'title' => ts('Start Event Adjust Interval') , |
| 249 | 'description' => 'Status range begins this many units from start_event.', |
| 250 | ) , |
| 251 | 'end_event' => array( |
| 252 | 'name' => 'end_event', |
| 253 | 'type' => CRM_Utils_Type::T_STRING, |
| 254 | 'title' => ts('End Event') , |
| 255 | 'description' => 'Event after which this status ends.', |
| 256 | 'maxlength' => 12, |
| 257 | 'size' => CRM_Utils_Type::TWELVE, |
| 258 | 'html' => array( |
| 259 | 'type' => 'Select', |
| 260 | ) , |
| 261 | 'pseudoconstant' => array( |
| 262 | 'callback' => 'CRM_Core_SelectValues::eventDate', |
| 263 | ) |
| 264 | ) , |
| 265 | 'end_event_adjust_unit' => array( |
| 266 | 'name' => 'end_event_adjust_unit', |
| 267 | 'type' => CRM_Utils_Type::T_STRING, |
| 268 | 'title' => ts('End Event Adjust Unit') , |
| 269 | 'description' => 'Unit used for adjusting from the ending event.', |
| 270 | 'maxlength' => 8, |
| 271 | 'size' => CRM_Utils_Type::EIGHT, |
| 272 | 'html' => array( |
| 273 | 'type' => 'Select', |
| 274 | ) , |
| 275 | 'pseudoconstant' => array( |
| 276 | 'callback' => 'CRM_Core_SelectValues::unitList', |
| 277 | ) |
| 278 | ) , |
| 279 | 'end_event_adjust_interval' => array( |
| 280 | 'name' => 'end_event_adjust_interval', |
| 281 | 'type' => CRM_Utils_Type::T_INT, |
| 282 | 'title' => ts('End Event Adjust Interval') , |
| 283 | 'description' => 'Status range ends this many units from end_event.', |
| 284 | ) , |
| 285 | 'is_current_member' => array( |
| 286 | 'name' => 'is_current_member', |
| 287 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 288 | 'title' => ts('Current Membership?') , |
| 289 | 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).', |
| 290 | ) , |
| 291 | 'is_admin' => array( |
| 292 | 'name' => 'is_admin', |
| 293 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 294 | 'title' => ts('Admin Assigned Only?') , |
| 295 | 'description' => 'Is this status for admin/manual assignment only.', |
| 296 | ) , |
| 297 | 'weight' => array( |
| 298 | 'name' => 'weight', |
| 299 | 'type' => CRM_Utils_Type::T_INT, |
| 300 | 'title' => ts('Order') , |
| 301 | ) , |
| 302 | 'is_default' => array( |
| 303 | 'name' => 'is_default', |
| 304 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 305 | 'title' => ts('Default Status?') , |
| 306 | 'description' => 'Assign this status to a membership record if no other status match is found.', |
| 307 | ) , |
| 308 | 'is_active' => array( |
| 309 | 'name' => 'is_active', |
| 310 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 311 | 'title' => ts('Is Active') , |
| 312 | 'description' => 'Is this membership_status enabled.', |
| 313 | 'default' => '1', |
| 314 | ) , |
| 315 | 'is_reserved' => array( |
| 316 | 'name' => 'is_reserved', |
| 317 | 'type' => CRM_Utils_Type::T_BOOLEAN, |
| 318 | 'title' => ts('Is Reserved') , |
| 319 | 'description' => 'Is this membership_status reserved.', |
| 320 | ) , |
| 321 | ); |
| 322 | } |
| 323 | return self::$_fields; |
| 324 | } |
| 325 | /** |
| 326 | * Returns an array containing, for each field, the arary key used for that |
| 327 | * field in self::$_fields. |
| 328 | * |
| 329 | * @return array |
| 330 | */ |
| 331 | static function &fieldKeys() { |
| 332 | if (!(self::$_fieldKeys)) { |
| 333 | self::$_fieldKeys = array( |
| 334 | 'id' => 'id', |
| 335 | 'name' => 'membership_status', |
| 336 | 'label' => 'label', |
| 337 | 'start_event' => 'start_event', |
| 338 | 'start_event_adjust_unit' => 'start_event_adjust_unit', |
| 339 | 'start_event_adjust_interval' => 'start_event_adjust_interval', |
| 340 | 'end_event' => 'end_event', |
| 341 | 'end_event_adjust_unit' => 'end_event_adjust_unit', |
| 342 | 'end_event_adjust_interval' => 'end_event_adjust_interval', |
| 343 | 'is_current_member' => 'is_current_member', |
| 344 | 'is_admin' => 'is_admin', |
| 345 | 'weight' => 'weight', |
| 346 | 'is_default' => 'is_default', |
| 347 | 'is_active' => 'is_active', |
| 348 | 'is_reserved' => 'is_reserved', |
| 349 | ); |
| 350 | } |
| 351 | return self::$_fieldKeys; |
| 352 | } |
| 353 | /** |
| 354 | * Returns the names of this table |
| 355 | * |
| 356 | * @return string |
| 357 | */ |
| 358 | static function getTableName() { |
| 359 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
| 360 | } |
| 361 | /** |
| 362 | * Returns if this table needs to be logged |
| 363 | * |
| 364 | * @return boolean |
| 365 | */ |
| 366 | function getLog() { |
| 367 | return self::$_log; |
| 368 | } |
| 369 | /** |
| 370 | * Returns the list of fields that can be imported |
| 371 | * |
| 372 | * @param bool $prefix |
| 373 | * |
| 374 | * @return array |
| 375 | */ |
| 376 | static function &import($prefix = false) { |
| 377 | if (!(self::$_import)) { |
| 378 | self::$_import = array(); |
| 379 | $fields = self::fields(); |
| 380 | foreach($fields as $name => $field) { |
| 381 | if (CRM_Utils_Array::value('import', $field)) { |
| 382 | if ($prefix) { |
| 383 | self::$_import['membership_status'] = & $fields[$name]; |
| 384 | } else { |
| 385 | self::$_import[$name] = & $fields[$name]; |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | return self::$_import; |
| 391 | } |
| 392 | /** |
| 393 | * Returns the list of fields that can be exported |
| 394 | * |
| 395 | * @param bool $prefix |
| 396 | * |
| 397 | * @return array |
| 398 | */ |
| 399 | static function &export($prefix = false) { |
| 400 | if (!(self::$_export)) { |
| 401 | self::$_export = array(); |
| 402 | $fields = self::fields(); |
| 403 | foreach($fields as $name => $field) { |
| 404 | if (CRM_Utils_Array::value('export', $field)) { |
| 405 | if ($prefix) { |
| 406 | self::$_export['membership_status'] = & $fields[$name]; |
| 407 | } else { |
| 408 | self::$_export[$name] = & $fields[$name]; |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | return self::$_export; |
| 414 | } |
| 415 | } |