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


PHP error::createInvalidJSONLDError方法代碼示例

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


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

示例1: load


//.........這裏部分代碼省略.........
                     $role = new Role();
                     $role->name = $node->rolename;
                     $role->image = $this->nodeimages[$node->rolename];
                     $node->role = $role;
                 }
                 $this->nodeArray[$nodeid] = $node;
                 $this->nodeSet->add($node);
             }
             $this->nodeSet->count = count($this->nodeSet->nodes);
             $this->nodeSet->totalno = $this->nodeSet->count;
         }
         $count = count($this->linkArray);
         if ($count > 0) {
             // PREPROCESS to get linktype counts
             for ($i = 0; $i < $count; $i++) {
                 $link = $this->linkArray[$i];
                 $fromid = $link['fromid'];
                 $toid = $link['toid'];
                 $linkname = $link['linkname'];
                 if (array_key_exists($fromid, $this->nodeArray)) {
                     $fromNode = $this->nodeArray[$fromid];
                     if ($linkname == $CFG->LINK_PRO_SOLUTION) {
                         $fromNode->procount = $fromNode->procount + 1;
                     } else {
                         if ($linkname == $CFG->LINK_CON_SOLUTION) {
                             $fromNode->concount = $fromNode->concount + 1;
                         } else {
                             $fromNode->othercount = $fromNode->othercount + 1;
                         }
                     }
                 }
             }
             // PROCESS CONNECTIONS INTO SET
             $i = 0;
             for ($i = 0; $i < $count; $i++) {
                 $link = $this->linkArray[$i];
                 $id = $link['id'];
                 $fromid = $link['fromid'];
                 $toid = $link['toid'];
                 $linkname = $link['linkname'];
                 $type = $link['type'];
                 //error_log($type);
                 $con = new Connection($id);
                 $con->linklabelname = $linkname;
                 $con->type = $type;
                 //error_log(print_r($this->nodeArray, true));
                 $fromNode = "";
                 if (array_key_exists($fromid, $this->nodeArray)) {
                     //error_log("from node");
                     $fromNode = $this->nodeArray[$fromid];
                     //error_log("concount".$fromNode->concount);
                     //error_log("procount".$fromNode->procount);
                     //error_log("othercount".$fromNode->othercount);
                     if ($linkname == $CFG->LINK_PRO_SOLUTION && $fromNode->concount == 0 && $fromNode->othercount == 0) {
                         $fromNode->rolename = 'Pro';
                     } else {
                         if ($linkname == $CFG->LINK_CON_SOLUTION && $fromNode->procount == 0 && $fromNode->othercount == 0) {
                             $fromNode->rolename = 'Con';
                         }
                     }
                     $role = new Role();
                     $role->name = $fromNode->rolename;
                     if (array_key_exists($fromNode->rolename, $this->nodeimages)) {
                         $role->image = $this->nodeimages[$fromNode->rolename];
                     }
                     $fromNode->role = $role;
                     $con->fromrole = $role;
                 }
                 $toNode = "";
                 if (array_key_exists($toid, $this->nodeArray)) {
                     $toNode = $this->nodeArray[$toid];
                     $role = new Role();
                     $role->name = $toNode->rolename;
                     if (array_key_exists($toNode->rolename, $this->nodeimages)) {
                         $role->image = $this->nodeimages[$toNode->rolename];
                     }
                     $toNode->role = $role;
                     $con->torole = $role;
                 }
                 if ($fromNode != "" && $toNode != "") {
                     $con->from = $fromNode;
                     $con->to = $toNode;
                     if (array_key_exists($id, $this->votesArray)) {
                         $votes = $this->votesArray[$id];
                         $con->votes = $votes;
                     }
                     $this->connectionSet->add($con);
                 }
             }
             $this->connectionSet->count = count($this->connectionSet->connections);
             $this->connectionSet->totalno = $this->connectionSet->count;
         }
         return $this;
     } else {
         global $ERROR;
         $ERROR = new error();
         $ERROR->createInvalidJSONLDError(json_last_error());
         return $ERROR;
     }
 }
開發者ID:uniteddiversity,項目名稱:CIDashboard,代碼行數:101,代碼來源:catalyst_jsonld_reader.class.php


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