Occurrence::save_occurrences( $args )

Method to save the occurrences from an event.


Parameters

$args,...

(mixed) (Required) The arguments that should be used to generate and save the Occurrences.


Top ↑

Return

(void) The method has the side-effect of generating and saving Occurrences for the Event.


Top ↑

Source

File: src/Events/Custom_Tables/V1/Models/Occurrence.php

	public function save_occurrences( ...$args ) {
		$insertions = $this->get_occurrences( ...$args );

		if ( count( $insertions ) ) {
			self::insert( $insertions );

			/**
			 * Fires after Occurrences for an Event have been inserted.
			 *
			 * @since 6.0.0
			 *
			 * @param int   $post_id    The ID of the Event post the Occurrences are being saved for.
			 * @param array $insertions The inserted Occurrences.
			 */
			do_action( 'tec_events_custom_tables_v1_after_insert_occurrences', $this->event->post_id, $insertions );
		}

		/**
		 * Fires after Occurrences for an Event have been inserted, or updated, in
		 * the custom tables.
		 *
		 * @since 6.0.0
		 *
		 * @param int $post_id The ID of the Event post the Occurrences are being saved for.
		 */
		do_action( 'tec_events_custom_tables_v1_after_save_occurrences', $this->event->post_id );
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.