当前位置: 首页>>代码示例>>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;未经允许,请勿转载。