Automattic\WooCommerce\Internal\DataStores\Orders

LegacyDataCleanup::toggle_flag()publicWC 1.0

Sets the flag that indicates that the cleanup process should be initiated.

Метод класса: LegacyDataCleanup{}

Хуков нет.

Возвращает

true|false. Whether the legacy data cleanup was initiated or not.

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

$LegacyDataCleanup = new LegacyDataCleanup();
$LegacyDataCleanup->toggle_flag( $enabled ): bool;
$enabled(true|false) (обязательный)
TRUE if the process should be initiated, FALSE if it should be canceled.

Код LegacyDataCleanup::toggle_flag() WC 9.7.1

public function toggle_flag( bool $enabled ): bool {
	if ( $enabled && $this->can_run() ) {
		$this->batch_processing->enqueue_processor( self::class );
		return true;
	} else {
		$this->batch_processing->remove_processor( self::class );
		return $enabled ? false : true;
	}
}