<?php
namespace Jet_Engine_Divi_Views\Components;

// Prevent direct access to the file.
if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Base component class
 */
abstract class Base_Component {

	/**
	 * Constructor
	 */
	public function __construct() {
		if ( $this->is_active() ) {
			$this->register();
		}
	}

	/**
	 * Check if component is active.
	 * Can be rewritten in child class to check if component is active.
	 *
	 * @return boolean
	 */
	public function is_active() {
		return true;
	}

	/**
	 * Register component
	 *
	 * @return void
	 */
	abstract public function register();

	/**
	 * Get component ID
	 *
	 * @return string
	 */
	abstract public function get_id();
}
