Complex classes like EE_Registration often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use EE_Registration, and based on these observations, apply Extract Interface, too.
| 1 | <?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
||
| 11 | class EE_Registration extends EE_Soft_Delete_Base_Class implements EEI_Registration { |
||
| 12 | |||
| 13 | |||
| 14 | /** |
||
| 15 | * Used to reference when a registration has never been checked in. |
||
| 16 | * @type int |
||
| 17 | */ |
||
| 18 | const checkin_status_never = 2; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Used to reference when a registration has been checked in. |
||
| 22 | * @type int |
||
| 23 | */ |
||
| 24 | const checkin_status_in = 1; |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * Used to reference when a registration has been checked out. |
||
| 29 | * @type int |
||
| 30 | */ |
||
| 31 | const checkin_status_out = 0; |
||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | /** |
||
| 36 | * |
||
| 37 | * @param array $props_n_values incoming values |
||
| 38 | * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
||
| 39 | * used.) |
||
| 40 | * @param array $date_formats incoming date_formats in an array where the first value is the |
||
| 41 | * date_format and the second value is the time format |
||
| 42 | * @return EE_Registration |
||
| 43 | */ |
||
| 44 | public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * @param array $props_n_values incoming values from the database |
||
| 53 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
||
| 54 | * the website will be used. |
||
| 55 | * @return EE_Registration |
||
| 56 | */ |
||
| 57 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | /** |
||
| 64 | * Set Event ID |
||
| 65 | * |
||
| 66 | * @access public |
||
| 67 | * @param int $EVT_ID Event ID |
||
| 68 | */ |
||
| 69 | public function set_event( $EVT_ID = 0 ) { |
||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | /** |
||
| 76 | * Overrides parent set() method so that all calls to set( 'REG_code', $REG_code ) OR set( 'STS_ID', $STS_ID ) can be routed to internal methods |
||
| 77 | * @param string $field_name |
||
| 78 | * @param mixed $field_value |
||
| 79 | * @param bool $use_default |
||
| 80 | */ |
||
| 81 | public function set( $field_name, $field_value, $use_default = FALSE ) { |
||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | /** |
||
| 99 | * Set Status ID |
||
| 100 | * updates the registration status and ALSO... |
||
| 101 | * calls reserve_registration_space() if the reg status changes TO approved from any other reg status |
||
| 102 | * calls release_registration_space() if the reg status changes FROM approved to any other reg status |
||
| 103 | * |
||
| 104 | * @access public |
||
| 105 | * @param string $new_STS_ID |
||
| 106 | * @param boolean $use_default |
||
| 107 | * @return bool |
||
| 108 | */ |
||
| 109 | public function set_status( $new_STS_ID = NULL, $use_default = FALSE ) { |
||
| 136 | |||
| 137 | |||
| 138 | |||
| 139 | /** |
||
| 140 | * get Status ID |
||
| 141 | * @access public |
||
| 142 | */ |
||
| 143 | public function status_ID() { |
||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | /** |
||
| 150 | * increments this registration's related ticket sold and corresponding datetime sold values |
||
| 151 | * @return void |
||
| 152 | */ |
||
| 153 | private function _reserve_registration_space() { |
||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | /** |
||
| 164 | * Gets the ticket this registration is for |
||
| 165 | * |
||
| 166 | * @param boolean $include_archived whether to include archived tickets or not. |
||
| 167 | * @return EE_Ticket |
||
| 168 | */ |
||
| 169 | public function ticket( $include_archived = TRUE ) { |
||
| 176 | |||
| 177 | |||
| 178 | |||
| 179 | /** |
||
| 180 | * Gets the event this registration is for |
||
| 181 | * @return EE_Event |
||
| 182 | */ |
||
| 183 | public function event() { |
||
| 186 | |||
| 187 | |||
| 188 | |||
| 189 | /** |
||
| 190 | * Gets the "author" of the registration. Note that for the purposes of registrations, the author will correspond with the author of the event this registration is for. |
||
| 191 | * |
||
| 192 | * @since 4.5.0 |
||
| 193 | * |
||
| 194 | * @return int |
||
| 195 | */ |
||
| 196 | public function wp_user() { |
||
| 203 | |||
| 204 | |||
| 205 | |||
| 206 | /** |
||
| 207 | * decrements (subtracts) this registration's related ticket sold and corresponding datetime sold values |
||
| 208 | * @return void |
||
| 209 | */ |
||
| 210 | private function _release_registration_space() { |
||
| 215 | |||
| 216 | |||
| 217 | |||
| 218 | /** |
||
| 219 | * Set Attendee ID |
||
| 220 | * |
||
| 221 | * @access public |
||
| 222 | * @param int $ATT_ID Attendee ID |
||
| 223 | */ |
||
| 224 | public function set_attendee_id( $ATT_ID = 0 ) { |
||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | /** |
||
| 231 | * Set Transaction ID |
||
| 232 | * |
||
| 233 | * @access public |
||
| 234 | * @param int $TXN_ID Transaction ID |
||
| 235 | */ |
||
| 236 | public function set_transaction_id( $TXN_ID = 0 ) { |
||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | /** |
||
| 243 | * Set Session |
||
| 244 | * |
||
| 245 | * @access public |
||
| 246 | * @param string $REG_session PHP Session ID |
||
| 247 | */ |
||
| 248 | public function set_session( $REG_session = '' ) { |
||
| 251 | |||
| 252 | |||
| 253 | |||
| 254 | /** |
||
| 255 | * Set Registration URL Link |
||
| 256 | * |
||
| 257 | * @access public |
||
| 258 | * @param string $REG_url_link Registration URL Link |
||
| 259 | */ |
||
| 260 | public function set_reg_url_link( $REG_url_link = '' ) { |
||
| 263 | |||
| 264 | |||
| 265 | |||
| 266 | /** |
||
| 267 | * Set Attendee Counter |
||
| 268 | * |
||
| 269 | * @access public |
||
| 270 | * @param int $REG_count Primary Attendee |
||
| 271 | */ |
||
| 272 | public function set_count( $REG_count = 1 ) { |
||
| 275 | |||
| 276 | |||
| 277 | |||
| 278 | /** |
||
| 279 | * Set Group Size |
||
| 280 | * |
||
| 281 | * @access public |
||
| 282 | * @param boolean $REG_group_size Group Registration |
||
| 283 | */ |
||
| 284 | public function set_group_size( $REG_group_size = FALSE ) { |
||
| 287 | |||
| 288 | |||
| 289 | |||
| 290 | /** |
||
| 291 | * is_not_approved - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_not_approved |
||
| 292 | * |
||
| 293 | * @access public |
||
| 294 | * @return boolean |
||
| 295 | */ |
||
| 296 | public function is_not_approved() { |
||
| 299 | |||
| 300 | |||
| 301 | |||
| 302 | /** |
||
| 303 | * is_pending_payment - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_pending_payment |
||
| 304 | * |
||
| 305 | * @access public |
||
| 306 | * @return boolean |
||
| 307 | */ |
||
| 308 | public function is_pending_payment() { |
||
| 311 | |||
| 312 | |||
| 313 | |||
| 314 | /** |
||
| 315 | * is_approved - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_approved |
||
| 316 | * |
||
| 317 | * @access public |
||
| 318 | * @return boolean |
||
| 319 | */ |
||
| 320 | public function is_approved() { |
||
| 323 | |||
| 324 | |||
| 325 | |||
| 326 | /** |
||
| 327 | * is_cancelled - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_cancelled |
||
| 328 | * |
||
| 329 | * @access public |
||
| 330 | * @return boolean |
||
| 331 | */ |
||
| 332 | public function is_cancelled() { |
||
| 335 | |||
| 336 | |||
| 337 | |||
| 338 | /** |
||
| 339 | * is_declined - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_declined |
||
| 340 | * |
||
| 341 | * @access public |
||
| 342 | * @return boolean |
||
| 343 | */ |
||
| 344 | public function is_declined() { |
||
| 347 | |||
| 348 | |||
| 349 | |||
| 350 | /** |
||
| 351 | * is_incomplete - convenience method that returns TRUE if REG status ID == EEM_Registration::status_id_incomplete |
||
| 352 | * |
||
| 353 | * @access public |
||
| 354 | * @return boolean |
||
| 355 | */ |
||
| 356 | public function is_incomplete() { |
||
| 359 | |||
| 360 | |||
| 361 | |||
| 362 | /** |
||
| 363 | * Set Registration Date |
||
| 364 | * |
||
| 365 | * @access public |
||
| 366 | * @param mixed ( int or string ) $REG_date Registration Date - Unix timestamp or string representation of Date |
||
| 367 | */ |
||
| 368 | public function set_reg_date( $REG_date = FALSE ) { |
||
| 371 | |||
| 372 | |||
| 373 | |||
| 374 | /** |
||
| 375 | * Set final price owing for this registration after all ticket/price modifications |
||
| 376 | * |
||
| 377 | * @access public |
||
| 378 | * @param float $REG_final_price |
||
| 379 | */ |
||
| 380 | public function set_final_price( $REG_final_price = 0.00 ) { |
||
| 383 | |||
| 384 | |||
| 385 | |||
| 386 | /** |
||
| 387 | * Set amount paid towards this registration's final price |
||
| 388 | * |
||
| 389 | * @access public |
||
| 390 | * @param float $REG_paid |
||
| 391 | */ |
||
| 392 | public function set_paid( $REG_paid = 0.00 ) { |
||
| 395 | |||
| 396 | |||
| 397 | |||
| 398 | /** |
||
| 399 | * Attendee Is Going |
||
| 400 | * |
||
| 401 | * @access public |
||
| 402 | * @param boolean $REG_att_is_going Attendee Is Going |
||
| 403 | */ |
||
| 404 | public function set_att_is_going( $REG_att_is_going = FALSE ) { |
||
| 407 | |||
| 408 | |||
| 409 | |||
| 410 | /** |
||
| 411 | * Gets the related attendee |
||
| 412 | * @return EE_Attendee |
||
| 413 | */ |
||
| 414 | public function attendee() { |
||
| 417 | |||
| 418 | |||
| 419 | |||
| 420 | /** |
||
| 421 | * get Event ID |
||
| 422 | * @access public |
||
| 423 | */ |
||
| 424 | public function event_ID() { |
||
| 427 | |||
| 428 | |||
| 429 | |||
| 430 | /** |
||
| 431 | * get Event ID |
||
| 432 | * @access public |
||
| 433 | */ |
||
| 434 | public function event_name() { |
||
| 442 | |||
| 443 | |||
| 444 | |||
| 445 | /** |
||
| 446 | * Fetches the event this registration is for |
||
| 447 | * @return EE_Event |
||
| 448 | */ |
||
| 449 | public function event_obj() { |
||
| 452 | |||
| 453 | |||
| 454 | |||
| 455 | /** |
||
| 456 | * get Attendee ID |
||
| 457 | * @access public |
||
| 458 | */ |
||
| 459 | public function attendee_ID() { |
||
| 462 | |||
| 463 | |||
| 464 | |||
| 465 | /** |
||
| 466 | * get PHP Session ID |
||
| 467 | * @access public |
||
| 468 | */ |
||
| 469 | public function session_ID() { |
||
| 472 | |||
| 473 | |||
| 474 | |||
| 475 | /** |
||
| 476 | * Gets the string which represents the URL trigger for the receipt template in the message template system. |
||
| 477 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
||
| 478 | * @return string |
||
| 479 | */ |
||
| 480 | public function receipt_url( $messenger = 'html' ) { |
||
| 496 | |||
| 497 | |||
| 498 | |||
| 499 | |||
| 500 | /** |
||
| 501 | * Gets the string which represents the URL trigger for the invoice template in the message template system. |
||
| 502 | * @param string $messenger 'pdf' or 'html'. Default 'html'. |
||
| 503 | * @return string |
||
| 504 | */ |
||
| 505 | public function invoice_url( $messenger = 'html' ) { |
||
| 529 | |||
| 530 | |||
| 531 | |||
| 532 | /** |
||
| 533 | * get Registration URL Link |
||
| 534 | * @access public |
||
| 535 | */ |
||
| 536 | public function reg_url_link() { |
||
| 539 | |||
| 540 | |||
| 541 | |||
| 542 | /** |
||
| 543 | * Echoes out invoice_url() |
||
| 544 | * @param string $type 'download','launch', or 'html' (default is 'launch') |
||
| 545 | * @return void |
||
| 546 | */ |
||
| 547 | public function e_invoice_url( $type = 'launch' ) { |
||
| 550 | |||
| 551 | |||
| 552 | |||
| 553 | /** |
||
| 554 | * Echoes out payment_overview_url |
||
| 555 | */ |
||
| 556 | public function e_payment_overview_url() { |
||
| 559 | |||
| 560 | |||
| 561 | |||
| 562 | /** |
||
| 563 | * Gets the URL of the thank you page with this registration REG_url_link added as |
||
| 564 | * a query parameter |
||
| 565 | * @return string |
||
| 566 | */ |
||
| 567 | public function payment_overview_url() { |
||
| 570 | |||
| 571 | |||
| 572 | |||
| 573 | /** |
||
| 574 | * Gets the URL of the thank you page with this registration REG_url_link added as |
||
| 575 | * a query parameter |
||
| 576 | * @return string |
||
| 577 | */ |
||
| 578 | public function edit_attendee_information_url() { |
||
| 581 | |||
| 582 | |||
| 583 | |||
| 584 | /** |
||
| 585 | * Simply generates and returns the appropriate admin_url link to edit this registration |
||
| 586 | * @return string |
||
| 587 | */ |
||
| 588 | public function get_admin_edit_url() { |
||
| 592 | |||
| 593 | |||
| 594 | |||
| 595 | /** |
||
| 596 | * is_primary_registrant? |
||
| 597 | * @access public |
||
| 598 | */ |
||
| 599 | public function is_primary_registrant() { |
||
| 602 | |||
| 603 | |||
| 604 | |||
| 605 | /** |
||
| 606 | * This returns the primary registration object for this registration group (which may be this object). |
||
| 607 | * @return EE_Registration |
||
| 608 | */ |
||
| 609 | public function get_primary_registration() { |
||
| 617 | |||
| 618 | |||
| 619 | |||
| 620 | /** |
||
| 621 | * get Attendee Number |
||
| 622 | * @access public |
||
| 623 | */ |
||
| 624 | public function count() { |
||
| 627 | |||
| 628 | |||
| 629 | |||
| 630 | /** |
||
| 631 | * get Group Size |
||
| 632 | * @access public |
||
| 633 | */ |
||
| 634 | public function group_size() { |
||
| 637 | |||
| 638 | |||
| 639 | |||
| 640 | /** |
||
| 641 | * get Registration Date |
||
| 642 | * @access public |
||
| 643 | */ |
||
| 644 | public function date() { |
||
| 647 | |||
| 648 | |||
| 649 | |||
| 650 | /** |
||
| 651 | * gets a pretty date |
||
| 652 | * @param string $date_format |
||
| 653 | * @param string $time_format |
||
| 654 | * @return string |
||
| 655 | */ |
||
| 656 | public function pretty_date( $date_format = NULL, $time_format = NULL ) { |
||
| 659 | |||
| 660 | |||
| 661 | |||
| 662 | /** |
||
| 663 | * final_price |
||
| 664 | * the registration's share of the transaction total, so that the |
||
| 665 | * sum of all the transaction's REG_final_prices equal the transaction's total |
||
| 666 | * @access public |
||
| 667 | * @return float |
||
| 668 | */ |
||
| 669 | public function final_price() { |
||
| 672 | |||
| 673 | |||
| 674 | |||
| 675 | /** |
||
| 676 | * pretty_final_price |
||
| 677 | * final price as formatted string, with correct decimal places and currency symbol |
||
| 678 | * @return string |
||
| 679 | */ |
||
| 680 | public function pretty_final_price() { |
||
| 683 | |||
| 684 | |||
| 685 | |||
| 686 | /** |
||
| 687 | * get paid (yeah) |
||
| 688 | * @access public |
||
| 689 | * @return float |
||
| 690 | */ |
||
| 691 | public function paid() { |
||
| 694 | |||
| 695 | |||
| 696 | |||
| 697 | /** |
||
| 698 | * pretty_paid |
||
| 699 | * @access public |
||
| 700 | * @return float |
||
| 701 | */ |
||
| 702 | public function pretty_paid() { |
||
| 705 | |||
| 706 | |||
| 707 | |||
| 708 | /** |
||
| 709 | * owes_monies_and_can_pay |
||
| 710 | * whether or not this registration has monies owing and it's' status allows payment |
||
| 711 | * @access public |
||
| 712 | * @param array $requires_payment |
||
| 713 | * @return bool |
||
| 714 | */ |
||
| 715 | public function owes_monies_and_can_pay( $requires_payment = array()) { |
||
| 728 | |||
| 729 | |||
| 730 | |||
| 731 | /** |
||
| 732 | * Prints out the return value of $this->pretty_status() |
||
| 733 | * @param bool $show_icons |
||
| 734 | * @return void |
||
| 735 | */ |
||
| 736 | public function e_pretty_status( $show_icons = FALSE ) { |
||
| 739 | |||
| 740 | |||
| 741 | |||
| 742 | |||
| 743 | /** |
||
| 744 | * Returns a nice version of the status for displaying to customers |
||
| 745 | * @param bool $show_icons |
||
| 746 | * @return string |
||
| 747 | */ |
||
| 748 | public function pretty_status( $show_icons = FALSE ) { |
||
| 773 | |||
| 774 | |||
| 775 | |||
| 776 | /** |
||
| 777 | * get Attendee Is Going |
||
| 778 | * @access public |
||
| 779 | */ |
||
| 780 | public function att_is_going() { |
||
| 783 | |||
| 784 | |||
| 785 | |||
| 786 | /** |
||
| 787 | * Gets related answers |
||
| 788 | * @param array $query_params like EEM_Base::get_all |
||
| 789 | * @return EE_Answer[] |
||
| 790 | */ |
||
| 791 | public function answers( $query_params = NULL ) { |
||
| 794 | |||
| 795 | |||
| 796 | |||
| 797 | /** |
||
| 798 | * Gets the registration's answer value to the specified question |
||
| 799 | * (either the question's ID or a question object) |
||
| 800 | * @param EE_Question|int $question |
||
| 801 | * @param bool $pretty_value |
||
| 802 | * @return array|string if pretty_value= true, the result will always be a string |
||
| 803 | * (because the answer might be an array of answer values, so passing pretty_value=true |
||
| 804 | * will convert it into some kind of string) |
||
| 805 | */ |
||
| 806 | public function answer_value_to_question( $question, $pretty_value=true ) { |
||
| 810 | |||
| 811 | |||
| 812 | |||
| 813 | /** |
||
| 814 | * question_groups |
||
| 815 | * returns an array of EE_Question_Group objects for this registration |
||
| 816 | * |
||
| 817 | * @return EE_Question_Group[] |
||
| 818 | */ |
||
| 819 | public function question_groups() { |
||
| 833 | |||
| 834 | |||
| 835 | |||
| 836 | /** |
||
| 837 | * count_question_groups |
||
| 838 | * returns a count of the number of EE_Question_Group objects for this registration |
||
| 839 | * |
||
| 840 | * @return int |
||
| 841 | */ |
||
| 842 | public function count_question_groups() { |
||
| 856 | |||
| 857 | |||
| 858 | |||
| 859 | /** |
||
| 860 | * Returns the registration date in the 'standard' string format |
||
| 861 | * (function may be improved in the future to allow for different formats and timezones) |
||
| 862 | * @return string |
||
| 863 | */ |
||
| 864 | public function reg_date() { |
||
| 867 | |||
| 868 | |||
| 869 | |||
| 870 | /** |
||
| 871 | * Gets the datetime-ticket for this registration (ie, it can be used to isolate |
||
| 872 | * the ticket this registration purchased, or the datetime they have registered |
||
| 873 | * to attend) |
||
| 874 | * @return EE_Datetime_Ticket |
||
| 875 | */ |
||
| 876 | public function datetime_ticket() { |
||
| 879 | |||
| 880 | |||
| 881 | |||
| 882 | /** |
||
| 883 | * Sets the registration's datetime_ticket. |
||
| 884 | * @param EE_Datetime_Ticket $datetime_ticket |
||
| 885 | * @return EE_Datetime_Ticket |
||
| 886 | */ |
||
| 887 | public function set_datetime_ticket( $datetime_ticket ) { |
||
| 890 | /** |
||
| 891 | * Gets deleted |
||
| 892 | * @return boolean |
||
| 893 | */ |
||
| 894 | public function deleted() { |
||
| 897 | |||
| 898 | /** |
||
| 899 | * Sets deleted |
||
| 900 | * @param boolean $deleted |
||
| 901 | * @return boolean |
||
| 902 | */ |
||
| 903 | public function set_deleted($deleted) { |
||
| 906 | |||
| 907 | |||
| 908 | |||
| 909 | /** |
||
| 910 | * Get the status object of this object |
||
| 911 | * @return EE_Status |
||
| 912 | */ |
||
| 913 | public function status_obj() { |
||
| 916 | |||
| 917 | |||
| 918 | |||
| 919 | /** |
||
| 920 | * Returns the number of times this registration has checked into any of the datetimes |
||
| 921 | * its available for |
||
| 922 | * @return int |
||
| 923 | */ |
||
| 924 | public function count_checkins() { |
||
| 927 | |||
| 928 | |||
| 929 | |||
| 930 | /** |
||
| 931 | * Returns the number of current Check-ins this registration is checked into for any of the datetimes the registration is for. Note, this is ONLY checked in (does not include checkedout) |
||
| 932 | * @return int |
||
| 933 | */ |
||
| 934 | public function count_checkins_not_checkedout() { |
||
| 937 | |||
| 938 | |||
| 939 | |||
| 940 | /** |
||
| 941 | * The purpose of this method is simply to check whether this registration can checkin to the given datetime. |
||
| 942 | * |
||
| 943 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
||
| 944 | * @param bool $check_approved This is used to indicate whether the caller wants can_checkin to also consider registration status as well as datetime access. |
||
| 945 | * |
||
| 946 | * @return bool |
||
| 947 | */ |
||
| 948 | public function can_checkin( $DTT_OR_ID, $check_approved = TRUE ) { |
||
| 963 | |||
| 964 | |||
| 965 | /** |
||
| 966 | * This method verifies whether the user can checkin for the given datetime considering the max uses value set on the ticket. |
||
| 967 | * |
||
| 968 | * To do this, a query is done to get the count of the datetime records already checked into. If the datetime given does |
||
| 969 | * not have a check-in record and checking in for that datetime will exceed the allowed uses, then return false. Otherwise return true. |
||
| 970 | * |
||
| 971 | * @param int | EE_Datetime $DTT_OR_ID The datetime the registration is being checked against |
||
| 972 | * @return bool true means can checkin. false means cannot checkin. |
||
| 973 | */ |
||
| 974 | public function verify_can_checkin_against_TKT_uses( $DTT_OR_ID ) { |
||
| 1006 | |||
| 1007 | |||
| 1008 | |||
| 1009 | /** |
||
| 1010 | * toggle Check-in status for this registration |
||
| 1011 | * |
||
| 1012 | * Check-ins are toggled in the following order: |
||
| 1013 | * never checked in -> checked in |
||
| 1014 | * checked in -> checked out |
||
| 1015 | * checked out -> checked in |
||
| 1016 | * |
||
| 1017 | * |
||
| 1018 | * @param int $DTT_ID include specific datetime to toggle Check-in for. If not included or null, then it is assumed primary datetime is being toggled. |
||
| 1019 | * @param bool $verify If true then can_checkin() is used to verify whether the person can be checked in or not. Otherwise this forces change in checkin status. |
||
| 1020 | * @return int|BOOL the chk_in status toggled to OR false if nothing got changed. |
||
| 1021 | */ |
||
| 1022 | public function toggle_checkin_status( $DTT_ID = null, $verify = false ) { |
||
| 1076 | |||
| 1077 | |||
| 1078 | |||
| 1079 | /** |
||
| 1080 | * Gets the primary datetime related to this registration via the related Event to this registration |
||
| 1081 | * @return EE_Datetime |
||
| 1082 | */ |
||
| 1083 | public function get_related_primary_datetime() { |
||
| 1086 | |||
| 1087 | |||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * This method simply returns the check-in status for this registration and the given datetime. |
||
| 1091 | * @param int $DTT_ID The ID of the datetime we're checking against (if empty we'll get the primary datetime for this registration (via event) and use it's ID); |
||
| 1092 | * @param EE_Checkin $checkin If present, we use the given checkin object rather than the dtt_id. |
||
| 1093 | * @return int Integer representing Check-in status. |
||
| 1094 | */ |
||
| 1095 | public function check_in_status_for_datetime( $DTT_ID = 0, $checkin = NULL ) { |
||
| 1116 | |||
| 1117 | |||
| 1118 | |||
| 1119 | /** |
||
| 1120 | * This method returns a localized message for the toggled Check-in message. |
||
| 1121 | * @param int $DTT_ID include specific datetime to get the correct Check-in message. If not included or null, then it is assumed Check-in for primary datetime was toggled. |
||
| 1122 | * @param bool $error This just flags that you want an error message returned. This is put in so that the error message can be customized with the attendee name. |
||
| 1123 | * @return string internationalized message |
||
| 1124 | */ |
||
| 1125 | public function get_checkin_msg( $DTT_ID, $error = FALSE ) { |
||
| 1148 | |||
| 1149 | |||
| 1150 | |||
| 1151 | /** |
||
| 1152 | * Returns the related EE_Transaction to this registration |
||
| 1153 | * @return EE_Transaction |
||
| 1154 | */ |
||
| 1155 | public function transaction() { |
||
| 1158 | |||
| 1159 | |||
| 1160 | |||
| 1161 | |||
| 1162 | /** |
||
| 1163 | * get Registration Code |
||
| 1164 | * @access public |
||
| 1165 | */ |
||
| 1166 | public function reg_code() { |
||
| 1169 | |||
| 1170 | |||
| 1171 | |||
| 1172 | /** |
||
| 1173 | * get Transaction ID |
||
| 1174 | * @access public |
||
| 1175 | */ |
||
| 1176 | public function transaction_ID() { |
||
| 1179 | |||
| 1180 | |||
| 1181 | |||
| 1182 | /** |
||
| 1183 | * @return int |
||
| 1184 | */ |
||
| 1185 | public function ticket_ID() { |
||
| 1188 | |||
| 1189 | |||
| 1190 | |||
| 1191 | /** |
||
| 1192 | * Set Registration Code |
||
| 1193 | * |
||
| 1194 | * @access public |
||
| 1195 | * @param string $REG_code Registration Code |
||
| 1196 | * @param boolean $use_default |
||
| 1197 | */ |
||
| 1198 | public function set_reg_code( $REG_code, $use_default = FALSE ) { |
||
| 1213 | |||
| 1214 | |||
| 1215 | |||
| 1216 | |||
| 1217 | /** |
||
| 1218 | * Returns all other registrations in the same group as this registrant who have the same ticket option. |
||
| 1219 | * |
||
| 1220 | * Note, if you want to just get all registrations in the same transaction (group), use: |
||
| 1221 | * $registration->transaction()->registrations(); |
||
| 1222 | * |
||
| 1223 | * @since 4.5.0 |
||
| 1224 | * |
||
| 1225 | * @return EE_Registration[] or empty array if this isn't a group registration. |
||
| 1226 | */ |
||
| 1227 | public function get_all_other_registrations_in_group() { |
||
| 1241 | |||
| 1242 | |||
| 1243 | |||
| 1244 | /** |
||
| 1245 | * @param array $query_params |
||
| 1246 | * @return \EE_Registration[] |
||
| 1247 | */ |
||
| 1248 | public function payments( $query_params = array() ) { |
||
| 1251 | |||
| 1252 | |||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * @param array $query_params |
||
| 1256 | * @return \EE_Registration[] |
||
| 1257 | */ |
||
| 1258 | public function registration_payments( $query_params = array() ) { |
||
| 1261 | |||
| 1262 | |||
| 1263 | |||
| 1264 | /** |
||
| 1265 | * @deprecated |
||
| 1266 | * @since 4.7.0 |
||
| 1267 | * @access public |
||
| 1268 | */ |
||
| 1269 | public function price_paid() { |
||
| 1273 | |||
| 1274 | |||
| 1275 | |||
| 1276 | /** |
||
| 1277 | * @deprecated |
||
| 1278 | * @since 4.7.0 |
||
| 1279 | * @access public |
||
| 1280 | * @param float $REG_final_price |
||
| 1281 | */ |
||
| 1282 | public function set_price_paid( $REG_final_price = 0.00 ) { |
||
| 1286 | |||
| 1287 | |||
| 1288 | |||
| 1289 | /** |
||
| 1290 | * @deprecated |
||
| 1291 | * @since 4.7.0 |
||
| 1292 | * @return string |
||
| 1293 | */ |
||
| 1294 | public function pretty_price_paid() { |
||
| 1298 | |||
| 1299 | |||
| 1300 | } |
||
| 1301 | /* End of file EE_Registration.class.php */ |
||
| 1303 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.