コード例 #1
0
 public static function getInstance()
 {
     if (is_null(self::$s_instance)) {
         self::$s_instance = new ServiceHostRestriction();
     }
     return self::$s_instance;
 }
コード例 #2
0
 public static function CreateInstance2($restrictionType)
 {
     if ($restrictionType->IsRole()) {
         $restriction = ServiceRoleRestriction::getInstance();
         return $restriction;
     } else {
         if ($restrictionType->IsHost()) {
             $restriction = ServiceHostRestriction::getInstance();
             return $restriction;
         } else {
             if ($restrictionType->IsIPRange()) {
                 $restriction = ServiceIPRangeRestriction::getInstance();
                 return $restriction;
             } else {
                 if ($restrictionType->IsIP()) {
                     $restriction = ServiceIPRestriction::getInstance();
                     return $restriction;
                 }
             }
         }
     }
 }