Returns instance, if instance does not exist then creates new one and returns it

@return $this
546333
public static function getInstance()
    {
        $self = get_called_class();
        if (!isset(self::$instances[$self])) {
            self::$instances[$self] = new $self;
        }
        return self::$instances[$self];
    }
39612
public static function __instance()
        {
            if (empty(self::$__instance)) {
                self::$__instance = with(new \ReflectionClass(self::$__class))->newInstanceArgs(self::$__args);
            }

            return self::$__instance;
        }
1268280
public function create()
    {
        $instance = self::createOptionValue($this);
        $this->setId($instance->getId());
        return $instance;
    }
3761
public function create()
    {
        $instance = self::createDiscountPromotion($this);
        $this->setId($instance->getId());
        return $instance;
    }
918987
final public static function getInstance() {
	
		if (NULL == self::$instance) {
			self::$instance = new self();
			self::$instance->startChrono();
		}
		
		return self::$instance;
	
	}
1327223
static function GetInstance()
	{
		if (!self::$IS_INITIALIZED) self::Init();

		if (!self::$INSTANCE instanceof self) self::$INSTANCE = new self;

		return self::$INSTANCE;
	}
747584
public function create()
    {
        $instance = self::createCustomer($this);
        $this->setId($instance->getId());
        return $instance;
    }
1257397
private static function instance()
    {
        $currentClass = get_called_class();
        $instanceName = empty( self::$instance ) ? '' : new \ReflectionClass(self::$instance);
        if( empty( self::$instance ) || ( $instanceName->name != $currentClass ) ) {
            self::$instance = new static();
        }
        return self::$instance;
    }
1139326
public static function getInstance()
    {
        $accesor = static::getAccessor();

        if (!static::$instance instanceof $accesor) {
            static::beforeConstruct();

            $args = static::getArguments();

            static::$instance = static::make($accesor, $args);

            static::afterConstruct();
        }

        return static::$instance;
    }
621498
public function create(): Model
	{
		$model_class = $this->getModelClass();
		$instance = new $model_class;
		$this->fill($instance);

		return $instance;
	}
285831
public function getModelInstance()
    {
        if ($this->instance !== null) {
            return $this->instance;
        }
        $model = $this->getModel();
        if ($model === false) {
            return false;
        }
        $instance = new $model();

        return $instance;
    }
983844
public function create()
    {
        $instance = self::createStoreCreditPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
19621
public function create()
    {
        $instance = self::createState($this);
        $this->setId($instance->getId());
        return $instance;
    }
1161919
public static function GetInstance() {
      if (!isset(self::$_Instance)) {
         $c = __CLASS__;
         self::$_Instance = new $c();
      }
      return self::$_Instance;
   }
177052
public static function getInstance()
    {
        if (self::$_instance === null) {
            self::$_instance = new Config();
            if (self::$_instance->_store === null) {
                self::$_instance->_store = self::$_instance->_setStore();
            }
        }

        return self::$_instance;
    }
373848
public function instance()
    {
        $settings = $this->getValidatedSettings();

        $objectManager = $this->createObjectManager($settings);
        $logger = isset($settings['logger']) ? isset($settings['logger']) : null;

        $this->initializeRegistry($objectManager, $logger);

        return new DataMapper($objectManager);
    }
720008
public function create()
    {
        $instance = self::createDiscountCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }