当前位置: 首页>>代码示例>>PHP>>正文


PHP ServiceUtil::getParentIDIncoming方法代码示例

本文整理汇总了PHP中ServiceUtil::getParentIDIncoming方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceUtil::getParentIDIncoming方法的具体用法?PHP ServiceUtil::getParentIDIncoming怎么用?PHP ServiceUtil::getParentIDIncoming使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ServiceUtil的用法示例。


在下文中一共展示了ServiceUtil::getParentIDIncoming方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleLexicon

 private function handleLexicon(&$data, $curie)
 {
     require_once 'Config.php';
     //include 'Globals.php';
     //include 'JsonClientUtil.php';
     //$curie = "NIFCELL:sao2128417084";
     $data['curie'] = $curie;
     $treeObj = getTreeObj($curie);
     $data['treeObj'] = $treeObj;
     $parentID = getParentID($treeObj, $curie);
     $data['parentID'] = $parentID;
     $node = getNode($treeObj, $parentID);
     $data['node'] = $node;
     $mainNode = getNode($treeObj, $curie);
     $data['mainNode'] = $mainNode;
     $list = getChildrenIDs($treeObj, $curie);
     $data['list'] = $list;
     $leafHTML = "";
     $list->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
     for ($list->rewind(); $list->valid(); $list->next()) {
         $item = $list->current();
         $leaf = 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';
     $util = new ServiceUtil();
     $list2 = $util->getOtherChildrenIDs($treeObj, $curie, PropertyConfig::$has_proper_part);
     $partOfParentID = $util->getOtherParentID($treeObj, $curie, PropertyConfig::$has_proper_part);
     $partOfParenttNode = 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 = 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);
     $partOfParentID3 = $util->getParentIDIncoming($treeObj, $curie, PropertyConfig::$part_of);
     $partOfParenttNode3 = 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 = 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;
 }
开发者ID:NeuroscienceKnowledgeSpace,项目名称:KnowledgeSpace,代码行数:71,代码来源:Pages.php

示例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);
//.........这里部分代码省略.........
开发者ID:NeuroscienceKnowledgeSpace,项目名称:KnowledgeSpace,代码行数:101,代码来源:Tree_with_tabs2.php


注:本文中的ServiceUtil::getParentIDIncoming方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。