Esempio n. 1
0
 /**
  * Enter description here...
  *
  * @param string $key
  *
  * @return ckXsdType
  */
 public static function get($key)
 {
     if (isset(self::$typeRegistry[$key])) {
         return self::$typeRegistry[$key];
     } else {
         if (ckXsdSimpleType::isSimpleType($key)) {
             return self::set($key, ckXsdSimpleType::create($key));
         } else {
             if (ckXsdArrayType::isArrayType($key)) {
                 return self::set($key, ckXsdArrayType::create($key));
             } else {
                 if (class_exists($key, true)) {
                     return self::set($key, ckXsdComplexType::create($key));
                 } else {
                     return null;
                 }
             }
         }
     }
 }
 /**
  * Gets a xsd type with a given name from the registry or creates and registers a new one if none exists.
  *
  * @param string $typeName The name of the xsd type
  *
  * @return ckXsdType The xsd type object, or null if none exists or can be created
  */
 public static function get($typeName)
 {
     if (isset(self::$typeRegistry[$typeName])) {
         return self::$typeRegistry[$typeName];
     } else {
         if (ckXsdSimpleType::isSimpleType($typeName)) {
             return self::set($typeName, ckXsdSimpleType::create($typeName));
         } else {
             if ($typeName == 'array') {
                 return self::set($typeName, ckXsdArrayType::create('anyType' . ckXsdArrayType::ARRAY_SUFFIX));
             } else {
                 if (ckXsdArrayType::isArrayType($typeName)) {
                     return self::set($typeName, ckXsdArrayType::create($typeName));
                 } else {
                     if (class_exists($typeName, true)) {
                         return self::set($typeName, ckXsdComplexType::create($typeName));
                     } else {
                         return null;
                     }
                 }
             }
         }
     }
 }