當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Type::getEnumConstructs方法代碼示例

本文整理匯總了PHP中Type::getEnumConstructs方法的典型用法代碼示例。如果您正苦於以下問題:PHP Type::getEnumConstructs方法的具體用法?PHP Type::getEnumConstructs怎麽用?PHP Type::getEnumConstructs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Type的用法示例。


在下文中一共展示了Type::getEnumConstructs方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createEnumIndex

 static function createEnumIndex($e, $index, $params)
 {
     $c = _hx_array_get(Type::getEnumConstructs($e), $index);
     if ($c === null) {
         throw new HException($index . " is not a valid enum constructor index");
     }
     return Type::createEnum($e, $c, $params);
 }
開發者ID:slaskis,項目名稱:hxsinatra,代碼行數:8,代碼來源:Type.class.php

示例2: unserialize


//.........這裏部分代碼省略.........
             break;
         case 120:
             throw new HException($this->unserialize());
             break;
         case 99:
             $name = $this->unserialize();
             $cl = $this->resolver->resolveClass($name);
             if ($cl === null) {
                 throw new HException("Class not found " . _hx_string_or_null($name));
             }
             $o1 = Type::createEmptyInstance($cl);
             $this->cache->push($o1);
             $this->unserializeObject($o1);
             return $o1;
             break;
         case 119:
             $name1 = $this->unserialize();
             $edecl = $this->resolver->resolveEnum($name1);
             if ($edecl === null) {
                 throw new HException("Enum not found " . _hx_string_or_null($name1));
             }
             $e = $this->unserializeEnum($edecl, $this->unserialize());
             $this->cache->push($e);
             return $e;
             break;
         case 106:
             $name2 = $this->unserialize();
             $edecl1 = $this->resolver->resolveEnum($name2);
             if ($edecl1 === null) {
                 throw new HException("Enum not found " . _hx_string_or_null($name2));
             }
             $this->pos++;
             $index = $this->readDigits();
             $tag = _hx_array_get(Type::getEnumConstructs($edecl1), $index);
             if ($tag === null) {
                 throw new HException("Unknown enum index " . _hx_string_or_null($name2) . "@" . _hx_string_rec($index, ""));
             }
             $e1 = $this->unserializeEnum($edecl1, $tag);
             $this->cache->push($e1);
             return $e1;
             break;
         case 108:
             $l = new HList();
             $this->cache->push($l);
             $buf1 = $this->buf;
             while (ord(substr($this->buf, $this->pos, 1)) !== 104) {
                 $l->add($this->unserialize());
             }
             $this->pos++;
             return $l;
             break;
         case 98:
             $h = new haxe_ds_StringMap();
             $this->cache->push($h);
             $buf2 = $this->buf;
             while (ord(substr($this->buf, $this->pos, 1)) !== 104) {
                 $s1 = $this->unserialize();
                 $h->set($s1, $this->unserialize());
                 unset($s1);
             }
             $this->pos++;
             return $h;
             break;
         case 113:
             $h1 = new haxe_ds_IntMap();
             $this->cache->push($h1);
開發者ID:marcdraco,項目名稱:Webrathea,代碼行數:67,代碼來源:Unserializer.class.php

示例3: allEnums

 static function allEnums($e)
 {
     $all = new _hx_array(array());
     $_g = 0;
     $_g1 = Type::getEnumConstructs($e);
     while ($_g < $_g1->length) {
         $c = $_g1[$_g];
         ++$_g;
         $v = Reflect::field($e, $c);
         if (!Reflect::isFunction($v)) {
             $all->push($v);
         }
         unset($v, $c);
     }
     return $all;
 }
開發者ID:Raniratna,項目名稱:new_elearning,代碼行數:16,代碼來源:Type.class.php


注:本文中的Type::getEnumConstructs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。