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: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51:
<?php
namespace Core;
/**
* Class LoginController contains functions for user (de)authentication.
*
* @hooks
* <code>
* ('on_userauth', ['user' => $user]) // Called just after the login session has been created {@see \Core\LoginController::login}
* ('on_userdeauth', ['user' => Session::getUser()]) // Called just before destroying the login session. {@see \Core\LoginController::deauthenticateUser}
* </code>
* @package Core
*/
abstract class AbstractClass {
/**
* @var CLASS Controller The class instance.
* @internal
*/
protected static $instance;
/**
* @var CLASS Model The instance of the model
*/
protected $model;
/**
* Returns a LoginController instance, creating it if it did not exist.
* @return bool CLASS Controller
*/
final public static function singleton()
{
if (static::$instance === null) {
$v = __CLASS__;
static::$instance = new $v();// self();
}
return static::$instance;
}
/**
* Returns the instance of the model for this controller
* @return bool CLASS
*/
final public function getModel() {
return $this->model;
}
}