| @@ 1033-1041 (lines=9) @@ | ||
| 1030 | * @throws InvalidDataTypeException |
|
| 1031 | * @throws InvalidInterfaceException |
|
| 1032 | */ |
|
| 1033 | protected function decreaseReservedForDatetimes($qty = 1, array $datetimes = []) |
|
| 1034 | { |
|
| 1035 | $datetimes = ! empty($datetimes) ? $datetimes : $this->datetimes(); |
|
| 1036 | foreach ($datetimes as $datetime) { |
|
| 1037 | if ($datetime instanceof EE_Datetime) { |
|
| 1038 | $datetime->decreaseReserved($qty); |
|
| 1039 | } |
|
| 1040 | } |
|
| 1041 | } |
|
| 1042 | ||
| 1043 | ||
| 1044 | /** |
|
| @@ 1152-1161 (lines=10) @@ | ||
| 1149 | * @return void |
|
| 1150 | * @throws EE_Error |
|
| 1151 | */ |
|
| 1152 | public function set_qty($qty) |
|
| 1153 | { |
|
| 1154 | $datetimes = $this->datetimes(); |
|
| 1155 | foreach ($datetimes as $datetime) { |
|
| 1156 | if ($datetime instanceof EE_Datetime) { |
|
| 1157 | $qty = min($qty, $datetime->reg_limit()); |
|
| 1158 | } |
|
| 1159 | } |
|
| 1160 | $this->set('TKT_qty', $qty); |
|
| 1161 | } |
|
| 1162 | ||
| 1163 | ||
| 1164 | /** |
|