<?php

namespace Prodigy\includes\models;

use Prodigy\Includes\Content\Prodigy_Settings_Parser;

/**
 * Prodigy order class
 *
 * @version    3.2.6
 * @package    Prodigy
 * @subpackage Prodigy/includes
 */
class Prodigy_Options {

	/**
	 * @return bool|int|\mysqli_result|null
	 */
	public static function invalidate_app_options() {
		global $wpdb;

		$pattern = Prodigy_Settings_Parser::PLATFORM_APP;

		$result = $wpdb->query(
			$wpdb->prepare(
				"DELETE FROM $wpdb->options WHERE option_name LIKE %s",
				$pattern . '%'
			)
		);

		wp_cache_delete( 'alloptions', 'options' );
		wp_cache_delete( 'notoptions', 'options' );

		return $result;
	}
}
