| @@ 1305-1319 (lines=15) @@ | ||
| 1302 | * @throws InvalidDataTypeException |
|
| 1303 | * @throws EE_Error |
|
| 1304 | */ |
|
| 1305 | public function update_sold() |
|
| 1306 | { |
|
| 1307 | $count_regs_for_this_datetime = EEM_Registration::instance()->count( |
|
| 1308 | array( |
|
| 1309 | array( |
|
| 1310 | 'STS_ID' => EEM_Registration::status_id_approved, |
|
| 1311 | 'REG_deleted' => 0, |
|
| 1312 | 'Ticket.Datetime.DTT_ID' => $this->ID(), |
|
| 1313 | ), |
|
| 1314 | ) |
|
| 1315 | ); |
|
| 1316 | $this->set_sold($count_regs_for_this_datetime); |
|
| 1317 | $this->save(); |
|
| 1318 | return $count_regs_for_this_datetime; |
|
| 1319 | } |
|
| 1320 | ||
| 1321 | ||
| 1322 | /******************************************************************* |
|
| @@ 1423-1436 (lines=14) @@ | ||
| 1420 | * @return int |
|
| 1421 | * @throws EE_Error |
|
| 1422 | */ |
|
| 1423 | public function update_tickets_sold() |
|
| 1424 | { |
|
| 1425 | $count_regs_for_this_ticket = $this->count_registrations( |
|
| 1426 | array( |
|
| 1427 | array( |
|
| 1428 | 'STS_ID' => EEM_Registration::status_id_approved, |
|
| 1429 | 'REG_deleted' => 0, |
|
| 1430 | ), |
|
| 1431 | ) |
|
| 1432 | ); |
|
| 1433 | $this->set_sold($count_regs_for_this_ticket); |
|
| 1434 | $this->save(); |
|
| 1435 | return $count_regs_for_this_ticket; |
|
| 1436 | } |
|
| 1437 | ||
| 1438 | ||
| 1439 | /** |
|