本文整理汇总了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;
}
}