PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.8
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / codeinwp / themeisle-sdk / src / Common / Abstract_module.php

Abstract_module.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.8, at vendor/codeinwp/themeisle-sdk/src/Common/Abstract_module.php

67 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The abstract class for module definition.
4 *
5 * @package ThemeIsleSDK
6 * @subpackage Loader
7 * @copyright Copyright (c) 2017, Marius Cristea
8 * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9 * @since 3.0.0
10 */
11
12 namespace ThemeisleSDK\Common;
13
14 use ThemeisleSDK\Product;
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 /**
21 * Class Abstract_Module.
22 *
23 * @package ThemeisleSDK\Common
24 */
25 abstract class Abstract_Module {
26 /**
27 * Product which use the module.
28 *
29 * @var Product $product Product object.
30 */
31 protected $product = null;
32
33 /**
34 * Can load the module for the selected product.
35 *
36 * @param Product $product Product data.
37 *
38 * @return bool Should load module?
39 */
40 public abstract function can_load( $product );
41
42 /**
43 * Bootstrap the module.
44 *
45 * @param Product $product Product object.
46 */
47 public abstract function load( $product );
48
49 /**
50 * Check if the product is from partner.
51 *
52 * @param Product $product Product data.
53 *
54 * @return bool Is product from partner.
55 */
56 public function is_from_partner( $product ) {
57
58 foreach ( Module_Factory::$domains as $partner_domain ) {
59 if ( strpos( $product->get_store_url(), $partner_domain ) !== false ) {
60 return true;
61 }
62 }
63
64 return array_key_exists( $product->get_slug(), Module_Factory::$slugs );
65 }
66 }
67