/var/www/html_uk/wp-content/plugins/automatewoo/includes/Traits/IntegrationValidator.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace AutomateWoo\Traits;

use 
AutomateWoo\Exceptions\InvalidIntegration;
use 
AutomateWoo\Integrations;

/**
 * Trait IntegrationValidator
 *
 * Validate that an integration is active and is a compatible version.
 *
 * @since 5.3.0
 */
trait IntegrationValidator {

    
/**
     * Validate WooCommerce Bookings integration.
     *
     * @throws InvalidIntegration If integration is inactive or incompatible.
     */
    
protected function validate_bookings_integration() {
        
$name 'WooCommerce Bookings';

        if ( ! 
defined'WC_BOOKINGS_VERSION' ) ) {
            throw 
InvalidIntegration::plugin_not_activeesc_html$name ) );
        }
        if ( 
version_compareWC_BOOKINGS_VERSIONIntegrations::REQUIRED_BOOKINGS_VERSION'<' ) ) {
            throw 
InvalidIntegration::plugin_version_not_supportedesc_html$name ), esc_htmlIntegrations::REQUIRED_BOOKINGS_VERSION ) );
        }
    }
}