Tribe__Events__Aggregator__Record__Abstract::get_event_count( string $type = null )
Returns count of events in the queue.
Contents
Parameters
- $type
-
(string) (Optional) Type of event to count. "total" will count all events.
Default value: null
Return
(int)
Source
File: src/Tribe/Aggregator/Record/Abstract.php
public function get_event_count( $type = null ) {
if ( is_null( $type ) ) {
return 0;
}
if ( empty( $this->meta['activity'] ) || ! $this->meta['activity'] instanceof Tribe__Events__Aggregator__Record__Activity ) {
return 0;
}
switch ( $type ) {
case 'total':
return $this->meta['activity']->count( 'event', 'created' ) + $this->meta['activity']->count( 'event', 'updated' );
break;
default:
return $this->meta['activity']->count( 'event', $type );
break;
}
}