本文整理汇总了PHP中ServiceUtil::getChildrenIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceUtil::getChildrenIDs方法的具体用法?PHP ServiceUtil::getChildrenIDs怎么用?PHP ServiceUtil::getChildrenIDs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceUtil
的用法示例。
在下文中一共展示了ServiceUtil::getChildrenIDs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleLexicon
private function handleLexicon(&$data, $curie, $tempParentID)
{
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
$data['curie'] = $curie;
$treeObj = $util->getTreeObj($curie);
$data['treeObj'] = $treeObj;
$parentID = $tempParentID;
if (strcmp($parentID, "none") == 0) {
$parentID = $util->getParentID($treeObj, $curie);
}
$data['parentID'] = $parentID;
$node = $util->getNode($treeObj, $parentID);
$data['node'] = $node;
$mainNode = $util->getNode($treeObj, $curie);
$data['mainNode'] = $mainNode;
$list = $util->getChildrenIDs($treeObj, $curie);
$data['list'] = $list;
$leafHTML = "";
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list->rewind(); $list->valid(); $list->next()) {
$item = $list->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/SciCrunchKS/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul onlick=\"alert('test');\"><li><span><i class=\"icon-leaf\"></i>" . $leaf->lbl . "</span> <a href=\"".$leafLink."\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML'] = $leafHTML;
}
示例2: handleLexicon
private function handleLexicon(&$data, $curie, $tempParentID)
{
require_once 'ServiceUtil.php';
require_once 'Config.php';
$util = new ServiceUtil();
$data['curie'] = $curie;
$treeObj = $util->getTreeObj($curie);
$data['treeObj'] = $treeObj;
$parentID = $tempParentID;
if (strcmp($parentID, "none") == 0) {
$parentID = $util->getParentID($treeObj, $curie);
}
$data['parentID'] = $parentID;
$node = $util->getNode($treeObj, $parentID);
$data['node'] = $node;
$mainNode = $util->getNode($treeObj, $curie);
$data['mainNode'] = $mainNode;
$list = $util->getChildrenIDs($treeObj, $curie);
$data['list'] = $list;
$leafHTML = "";
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list->rewind(); $list->valid(); $list->next()) {
$item = $list->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML'] = $leafHTML;
$myConfig = new Config();
$myConfig->loadJsonConfig($data);
$util = new ServiceUtil();
//$list2 = $util->getOtherChildrenIDs($treeObj, $curie,PropertyConfig::$has_proper_part);
$list2 = $util->getOtherChildrenIDs($treeObj, $curie, $data["config_array"]->has_proper_part_property);
//$partOfParentID = $util->getOtherParentID($treeObj, $curie,PropertyConfig::$has_proper_part);
$partOfParentID = $util->getOtherParentID($treeObj, $curie, $data["config_array"]->has_proper_part_property);
$partOfParenttNode = $util->getNode($treeObj, $partOfParentID);
$data['node2'] = $partOfParenttNode;
$leafHTML = null;
$list2->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list2->rewind(); $list2->valid(); $list2->next()) {
$item = $list2->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML2'] = $leafHTML;
//$list3 = $util->getChildrenIDsIncoming($treeObj, $curie,PropertyConfig::$part_of);
$list3 = $util->getChildrenIDsIncoming($treeObj, $curie, $data["config_array"]->part_of_property);
//$partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie,PropertyConfig::$part_of);
$partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie, $data["config_array"]->part_of_property);
$partOfParenttNode3 = $util->getNode($treeObj, $partOfParentID3);
$data['node3'] = $partOfParenttNode3;
$leafHTML = null;
$list3->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list3->rewind(); $list3->valid(); $list3->next()) {
$item = $list3->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML3'] = $leafHTML;
/********************Loop properties***************************/
$relation_array = array();
$properties = $data["config_array"]->properties_included;
foreach ($properties as $property) {
//echo "<br/>".$property->name."-------".$property->value."\n";
/*$tempList = $util->getChildrenIDsIncoming($treeObj, $curie,$property->value);
$tempParentID = $util->getParentIDIncoming($treeObj, $curie,$property->value);*/
$tempList = NULL;
$tempParentID = NULL;
if (strcmp($property->direction, "in-coming")) {
$tempList = $util->getChildrenIDsIncoming($treeObj, $curie, $property->value);
$tempParentID = $util->getParentIDIncoming($treeObj, $curie, $property->value);
} else {
if (strcmp($property->direction, "out-going")) {
$tempList = $util->getOtherChildrenIDs($treeObj, $curie, $property->value);
$tempParentID = $util->getOtherParentID($treeObj, $curie, $property->value);
}
}
$tempPrarentNode = $util->getNode($treeObj, $tempParentID);
$leafHTML = null;
$tempList->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($tempList->rewind(); $tempList->valid(); $tempList->next()) {
$item = $tempList->current();
$leaf = $util->getNode($treeObj, $item);
//.........这里部分代码省略.........
示例3: handleLexicon
private function handleLexicon(&$data, $curie, $tempParentID)
{
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
$data['curie'] = $curie;
$treeObj = $util->getTreeObj($curie);
$data['treeObj'] = $treeObj;
$parentID = $tempParentID;
if (strcmp($parentID, "none") == 0) {
$parentID = $util->getParentID($treeObj, $curie);
}
$data['parentID'] = $parentID;
$node = $util->getNode($treeObj, $parentID);
$data['node'] = $node;
$mainNode = $util->getNode($treeObj, $curie);
$data['mainNode'] = $mainNode;
$list = $util->getChildrenIDs($treeObj, $curie);
$data['list'] = $list;
$leafHTML = "";
$list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list->rewind(); $list->valid(); $list->next()) {
$item = $list->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML'] = $leafHTML;
require_once 'ServiceUtil.php';
//require_once('PropertyConfig.php');
require_once 'Config.php';
$myConfig = new Config();
$myConfig->loadJsonConfig($data);
$util = new ServiceUtil();
//$list2 = $util->getOtherChildrenIDs($treeObj, $curie,PropertyConfig::$has_proper_part);
$list2 = $util->getOtherChildrenIDs($treeObj, $curie, $data["config_array"]->has_proper_part_property);
//$partOfParentID = $util->getOtherParentID($treeObj, $curie,PropertyConfig::$has_proper_part);
$partOfParentID = $util->getOtherParentID($treeObj, $curie, $data["config_array"]->has_proper_part_property);
$partOfParenttNode = $util->getNode($treeObj, $partOfParentID);
$data['node2'] = $partOfParenttNode;
$leafHTML = null;
$list2->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list2->rewind(); $list2->valid(); $list2->next()) {
$item = $list2->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML2'] = $leafHTML;
//$list3 = $util->getChildrenIDsIncoming($treeObj, $curie,PropertyConfig::$part_of);
$list3 = $util->getChildrenIDsIncoming($treeObj, $curie, $data["config_array"]->part_of_property);
//$partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie,PropertyConfig::$part_of);
$partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie, $data["config_array"]->part_of_property);
$partOfParenttNode3 = $util->getNode($treeObj, $partOfParentID3);
$data['node3'] = $partOfParenttNode3;
$leafHTML = null;
$list3->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
for ($list3->rewind(); $list3->valid(); $list3->next()) {
$item = $list3->current();
$leaf = $util->getNode($treeObj, $item);
$leafLinkName = str_replace(" ", "_", $leaf->lbl);
$leafLinkName = str_replace("(", "_", $leafLinkName);
$leafLinkName = str_replace(")", "_", $leafLinkName);
//$leafLink = "/SciCrunchKS/index.php/pages/view/".$leafLinkName;
$leafLink = "/" . Config::$localContextName . "/index.php/pages/view/" . $leaf->id;
//$leafHTML = $leafHTML . "<ul><li><span><i class=\"icon-leaf\"></i><a href=\"".$leafLink."\">" . $leaf->lbl . "</a></span> <a href=\"\"></a></li></ul>\n";
$leafHTML = $leafHTML . "<ul><li><span id=\"" . $leaf->id . "," . $mainNode->id . "\"><i class=\"icon-plus-sign\"></i>" . $leaf->lbl . "</span> <a href=\"" . $leafLink . "\"><img src=\"/img/view-icon.png\" width=\"25\" height=\"25\"></a></li></ul>\n";
}
$data['leafHTML3'] = $leafHTML;
}