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

コード例 #1
0
ファイル: GeocodedUserInfo.php プロジェクト: 8secs/cocina
 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