48 lines
686 B
PHP
48 lines
686 B
PHP
<?php
|
|
/**
|
|
* Created by CS medien- & kommunikationssysteme.
|
|
* @author Christian Steinle
|
|
* @date 02.08.2016
|
|
*
|
|
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
|
|
*/
|
|
|
|
namespace Singleton;
|
|
|
|
|
|
class SingletonAbstract
|
|
{
|
|
/**
|
|
* @var null|SingletonAbstract
|
|
*/
|
|
protected static $_instance = null;
|
|
|
|
|
|
/**
|
|
* Protected wegen Singleton
|
|
*/
|
|
final protected function __construct()
|
|
{
|
|
}
|
|
|
|
|
|
/**
|
|
* Protected wegen Singleton
|
|
*/
|
|
final protected function __clone()
|
|
{
|
|
}
|
|
|
|
|
|
/**
|
|
* @return SingletonAbstract
|
|
*/
|
|
public static function getInstance()
|
|
{
|
|
if (null === self::$_instance)
|
|
{
|
|
self::$_instance = new self;
|
|
}
|
|
return self::$_instance;
|
|
}
|
|
} |