ShopUserInfo::singleton PHP Method

singleton() public static method

public static singleton ( )
    public static function singleton()
    {
        static $singleton = null;
        if ($singleton === null) {
            $singleton = new ShopUserInfo();
        }
        return $singleton;
    }

Usage Example

Esempio n. 1
0
 public function contentcontrollerInit()
 {
     $location = ShopUserInfo::singleton()->getAddress();
     if (!$location || Controller::curr()->getRequest()->getVar('relocateuser')) {
         ShopUserInfo::singleton()->setAddress(new Address($this->findLocation()));
     }
 }
All Usage Examples Of ShopUserInfo::singleton