# tier-pricing-table/6.1.0/src/BackgroundProcessing/Updater/Updater.php

Tiered Pricing Table for WooCommerce, version 6.1.0. 38 lines.

- Page: https://pluginprobe.com/plugins/tier-pricing-table/6.1.0/code/src/BackgroundProcessing/Updater/Updater.php
- Raw: https://pluginprobe.com/plugins/tier-pricing-table/6.1.0/raw/src/BackgroundProcessing/Updater/Updater.php
- Modified: 2021-08-09T00:58:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tier-pricing-table/6.1.0/code/src/BackgroundProcessing/Updater/Updater.php#L10-L20`.

```php
<?php namespace TierPricingTable\BackgroundProcessing\Updater;

use TierPricingTable\TierPricingTablePlugin;

class Updater {

	const DB_OPTION = 'tiered_price_table_version';

	public function checkForUpdates() {
		return $this->compare( TierPricingTablePlugin::DB_VERSION );
	}

	/**
	 * Compare plugin versions
	 *
	 * @param $version
	 *
	 * @return mixed
	 */
	private function compare( $version ) {
		$dbVersion = get_option( self::DB_OPTION, '1.0.0' );

		return version_compare( $dbVersion, $version, '<' );
	}

	public function update() {
		foreach ( $this->getUpdates() as $version => $callback ) {
			if ( $this->compare( $version ) ) {
				call_user_func( $callback );
			}
		}
	}

	public function getUpdates() {
		return array();
	}
}

```
