<?php

declare(strict_types=1);

namespace kodorvan\surikov\models;

// Framework for PHP
use mirzaev\minimal\model;

// Built-in libraries
use pdo,
pdoexception,
exception;

/**
 * Core model
 *
 * @package kodorvan\surikov\models
 *
 * @param pdo $database Database
 *
 * @method void __construct(?pdo $database) Constructor
 * @method void __set(string $name, mixed $value) Write
 * @method mixed __get(string $name) Read
 * @method bool __isset(string $name) Isset
 * @method void __unset(string $name) Deinitialize
 * @method mixed __callStatic(string $name, mixed $arguments) Call static
 *
 * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
 * @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
 */
class core extends model
{
	/**
	 * Database
	 * 
	 * @see https://www.php.net/manual/en/book.pdo.php PDO
	 *
	 * @var pdo $database Database
	 */
	protected static pdo $database;

	/**
	 * Constructor
	 *
	 *
	 * @return void
	 */
	public function __construct()
	{
		// Initializing the database connetion
		self::$database = new pdo(DATABASE['type'] . ':dbname=' . DATABASE['name'] . ';host=' . DATABASE['host'], DATABASE['login'], DATABASE['password']);
	}
}
