| @@ 847-868 (lines=22) @@ | ||
| 844 | * @throws ReflectionException |
|
| 845 | * @since 4.9.80.p |
|
| 846 | */ |
|
| 847 | public function increaseSold($qty = 1) |
|
| 848 | { |
|
| 849 | $qty = absint($qty); |
|
| 850 | // increment sold and decrement reserved datetime quantities simultaneously |
|
| 851 | // don't worry about failures, because they must have already had a spot reserved |
|
| 852 | $this->increaseSoldForDatetimes($qty); |
|
| 853 | // Increment and decrement ticket quantities simultaneously |
|
| 854 | $success = $this->adjustNumericFieldsInDb( |
|
| 855 | [ |
|
| 856 | 'TKT_reserved' => $qty * -1, |
|
| 857 | 'TKT_sold' => $qty, |
|
| 858 | ] |
|
| 859 | ); |
|
| 860 | do_action( |
|
| 861 | 'AHEE__EE_Ticket__increase_sold', |
|
| 862 | $this, |
|
| 863 | $qty, |
|
| 864 | $this->sold(), |
|
| 865 | $success |
|
| 866 | ); |
|
| 867 | return $success; |
|
| 868 | } |
|
| 869 | ||
| 870 | ||
| 871 | /** |
|
| @@ 907-924 (lines=18) @@ | ||
| 904 | * @throws ReflectionException |
|
| 905 | * @since 4.9.80.p |
|
| 906 | */ |
|
| 907 | public function decreaseSold($qty = 1) |
|
| 908 | { |
|
| 909 | $qty = absint($qty); |
|
| 910 | $this->decreaseSoldForDatetimes($qty); |
|
| 911 | $success = $this->adjustNumericFieldsInDb( |
|
| 912 | [ |
|
| 913 | 'TKT_sold' => $qty * -1, |
|
| 914 | ] |
|
| 915 | ); |
|
| 916 | do_action( |
|
| 917 | 'AHEE__EE_Ticket__decrease_sold', |
|
| 918 | $this, |
|
| 919 | $qty, |
|
| 920 | $this->sold(), |
|
| 921 | $success |
|
| 922 | ); |
|
| 923 | return $success; |
|
| 924 | } |
|
| 925 | ||
| 926 | ||
| 927 | /** |
|