AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/popup-maker/classes/Plugin/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/popup-maker/classes/Plugin/Container.php

<?php
/**
 * Main plugin container.
 *
 * @package   PopupMaker
 * @copyright Copyright (c) 2024, Code Atlantic LLC
 */

namespace PopupMaker\Plugin;

use PopupMaker\Base\Controller;

/**
 * Main plugin container.
 */
class Container extends \PopupMaker\Base\Container {

	/**
	 * Array of controllers.
	 *
	 * Useful to unhook actions/filters from global space.
	 *
	 * @var \PopupMaker\Base\Container
	 */
	public $controllers;

	/**
	 * Initiate the plugin.
	 *
	 * @param array<string,string|bool> $config Configuration variables passed from main plugin file.
	 */
	public function __construct( $config ) {
		parent::__construct( $config );

		$this->controllers = new \PopupMaker\Base\Container();

		$this->register_services();
		$this->initiate_controllers();
	}

	/**
	 * Register services.
	 *
	 * @return void
	 */
	protected function register_services() {
		// Override in child class if needed.
	}

	/**
	 * Update & track version info.
	 *
	 * @return array<string,\PopupMaker\Base\Controller>
	 */
	protected function registered_controllers() {
		return [];
	}

	/**
	 * Register controllers.
	 *
	 * @param array<string,\PopupMaker\Interfaces\Controller> $controllers Array of controllers.
	 * @return void
	 */
	public function register_controllers( $controllers = [] ) {
		foreach ( $controllers as $name => $controller ) {
			if ( $controller instanceof \PopupMaker\Interfaces\Controller ) {
				$this->controllers->set( $name, $controller );
			}
		}

		foreach ( $controllers as $name => $controller ) {
			if ( $controller instanceof \PopupMaker\Interfaces\Controller && $controller->controller_enabled() ) {
				$controller->init();
			}
		}
	}

	/**
	 * Initiate internal components.
	 *
	 * @return void
	 */
	protected function initiate_controllers() {
		$this->register_controllers( $this->registered_controllers() );
	}

	/**
	 * Get a controller.
	 *
	 * @param string $name Controller name.
	 *
	 * @return Controller|null
	 */
	public function get_controller( $name ) {
		if ( ! $this->controllers->offsetExists( $name ) ) {
			return null;
		}

		$controller = $this->controllers->get( $name );

		if ( $controller instanceof Controller ) {
			return $controller;
		}

		return null;
	}

	public function offsetExists( $id ) {
		if ( parent::offsetExists( $id ) ) {
			return true;
		}

		if ( $this->controllers->offsetExists( $id ) ) {
			return true;
		}

		return false;
	}

	public function get( $id ) {
		// 1. Check if the item exists in the controllers container.
		if ( $this->controllers->offsetExists( $id ) ) {
			// Doing it wrong. Use get_controller() instead.
			_deprecated_function( __METHOD__, 'X.X.X', __CLASS__ . '::get_controller()' );
			return $this->controllers->get( $id );
		}

		return parent::get( $id );
	}

	/**
	 * Utility method to get a path.
	 *
	 * @param string $path Subpath to return.
	 * @return string
	 */
	public function get_path( $path = '' ) {
		return $this->get( 'path' ) . $path;
	}

	/**
	 * Utility method to get a url.
	 *
	 * @param string $path Sub url to return.
	 * @return string
	 */
	public function get_url( $path = '' ) {
		return $this->get( 'url' ) . $path;
	}
}

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question