@@ 841-851 (lines=11) @@ | ||
838 | * @return void |
|
839 | * @throws \EE_Error |
|
840 | */ |
|
841 | protected function _increase_sold_for_datetimes( $qty = 1 ) { |
|
842 | $datetimes = $this->datetimes(); |
|
843 | if ( is_array( $datetimes ) ) { |
|
844 | foreach ( $datetimes as $datetime ) { |
|
845 | if ( $datetime instanceof EE_Datetime ) { |
|
846 | $datetime->increase_sold( $qty ); |
|
847 | $datetime->save(); |
|
848 | } |
|
849 | } |
|
850 | } |
|
851 | } |
|
852 | ||
853 | ||
854 | ||
@@ 883-893 (lines=11) @@ | ||
880 | * @return void |
|
881 | * @throws \EE_Error |
|
882 | */ |
|
883 | protected function _decrease_sold_for_datetimes( $qty = 1 ) { |
|
884 | $datetimes = $this->datetimes(); |
|
885 | if ( is_array( $datetimes ) ) { |
|
886 | foreach ( $datetimes as $datetime ) { |
|
887 | if ( $datetime instanceof EE_Datetime ) { |
|
888 | $datetime->decrease_sold( $qty ); |
|
889 | $datetime->save(); |
|
890 | } |
|
891 | } |
|
892 | } |
|
893 | } |
|
894 | ||
895 | ||
896 | ||
@@ 953-963 (lines=11) @@ | ||
950 | * @return void |
|
951 | * @throws \EE_Error |
|
952 | */ |
|
953 | protected function _increase_reserved_for_datetimes( $qty = 1 ) { |
|
954 | $datetimes = $this->datetimes(); |
|
955 | if ( is_array( $datetimes ) ) { |
|
956 | foreach ( $datetimes as $datetime ) { |
|
957 | if ( $datetime instanceof EE_Datetime ) { |
|
958 | $datetime->increase_reserved( $qty ); |
|
959 | $datetime->save(); |
|
960 | } |
|
961 | } |
|
962 | } |
|
963 | } |
|
964 | ||
965 | ||
966 | ||
@@ 998-1008 (lines=11) @@ | ||
995 | * @return void |
|
996 | * @throws \EE_Error |
|
997 | */ |
|
998 | protected function _decrease_reserved_for_datetimes( $qty = 1 ) { |
|
999 | $datetimes = $this->datetimes(); |
|
1000 | if ( is_array( $datetimes ) ) { |
|
1001 | foreach ( $datetimes as $datetime ) { |
|
1002 | if ( $datetime instanceof EE_Datetime ) { |
|
1003 | $datetime->decrease_reserved( $qty ); |
|
1004 | $datetime->save(); |
|
1005 | } |
|
1006 | } |
|
1007 | } |
|
1008 | } |
|
1009 | ||
1010 | ||
1011 | ||
@@ 1120-1128 (lines=9) @@ | ||
1117 | * @return void |
|
1118 | * @throws \EE_Error |
|
1119 | */ |
|
1120 | public function set_qty( $qty ) { |
|
1121 | $datetimes = $this->datetimes(); |
|
1122 | foreach ( $datetimes as $datetime ) { |
|
1123 | if ( $datetime instanceof EE_Datetime ) { |
|
1124 | $qty = min( $qty, $datetime->reg_limit() ); |
|
1125 | } |
|
1126 | } |
|
1127 | $this->set( 'TKT_qty', $qty ); |
|
1128 | } |
|
1129 | ||
1130 | ||
1131 |