Tribe__Tickets__Tickets::tickets_own_stock( int $post_id )
Returns if the all the tickets for an event have own stock
Contents
Parameters
- $post_id
-
(int) (Required) ID of parent "event" post
Return
(bool)
Source
File: src/Tribe/Tickets.php
public static function tickets_own_stock( $post_id ) {
$tickets = self::get_all_event_tickets( $post_id );
// if no tickets or rsvp return false
if ( ! $tickets ) {
return false;
}
foreach ( $tickets as $ticket ) {
// if ticket and not RSVP
if ( 'Tribe__Tickets__RSVP' !== $ticket->provider_class ) {
$global_stock_mode = $ticket->global_stock_mode();
if ( Tribe__Tickets__Global_Stock::OWN_STOCK_MODE !== $global_stock_mode ) {
return false;
}
}
}
return true;
}