/**
  * Modifies pending spaces calculations for individual tickets to include paypal bookings, but only if PayPal bookings are set to time-out (i.e. they'll get deleted after x minutes), therefore can be considered as 'pending' and can be reserved temporarily.
  * @param integer $count
  * @param EM_Ticket $EM_Ticket
  * @return integer
  */
 function em_ticket_get_pending_spaces($count, $EM_Ticket)
 {
     foreach ($EM_Ticket->get_bookings()->bookings as $EM_Booking) {
         //get_bookings() is used twice so we get the confirmed (or all if confirmation disabled) bookings of this ticket's total bookings.
         if ($EM_Booking->booking_status == $this->status && $this->uses_gateway($EM_Booking)) {
             foreach ($EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking) {
                 if ($EM_Ticket_Booking->ticket_id == $EM_Ticket->ticket_id) {
                     $count += $EM_Ticket_Booking->get_spaces();
                 }
             }
         }
     }
     return $count;
 }