Action_Scheduler\Migration

LogMigrator::migrate()publicWC 1.0

Migrate an action log.

{} Это метод класса: LogMigrator{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$LogMigrator = new LogMigrator();
$LogMigrator->migrate( $source_action_id, $destination_action_id );
$source_action_id(int) (обязательный)
Source logger object.
$destination_action_id(int) (обязательный)
Destination logger object.

Код LogMigrator::migrate() WC 6.9.4

public function migrate( $source_action_id, $destination_action_id ) {
	$logs = $this->source->get_logs( $source_action_id );
	foreach ( $logs as $log ) {
		if ( $log->get_action_id() == $source_action_id ) {
			$this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
		}
	}
}