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


PHP MetaModel::EnumReferencingClasses方法代码示例

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


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

示例1: DisplayRelatedClassesBestInClass

/**
 * Helper for the global list and the details of a given class
 */
function DisplayRelatedClassesBestInClass($oPage, $sClass, $iLevels = 20, &$aVisitedClasses = array(), $bSubtree = true, $sContext)
{
    if ($iLevels <= 0) {
        return;
    }
    $iLevels--;
    if (array_key_exists($sClass, $aVisitedClasses)) {
        return;
    }
    $aVisitedClasses[$sClass] = true;
    if ($bSubtree) {
        $oPage->add("<ul class=\"treeview\">\n");
    }
    foreach (MetaModel::EnumParentClasses($sClass) as $sParentClass) {
        DisplayRelatedClassesBestInClass($oPage, $sParentClass, $iLevels, $aVisitedClasses, false, $sContext);
    }
    ////$oPage->add("<div style=\"background-color:#ccc; border: 1px dashed #333;\">");
    foreach (MetaModel::EnumReferencedClasses($sClass) as $sExtKeyAttCode => $sRemoteClass) {
        $sVisited = array_key_exists($sRemoteClass, $aVisitedClasses) ? " ..." : "";
        if (MetaModel::GetAttributeOrigin($sClass, $sExtKeyAttCode) == $sClass) {
            $oPage->add("<li>{$sClass}| <em>{$sExtKeyAttCode}</em> =&gt;" . MakeClassHLink($sRemoteClass, $sContext) . "{$sVisited}</li>\n");
            DisplayRelatedClassesBestInClass($oPage, $sRemoteClass, $iLevels, $aVisitedClasses, true, $sContext);
        }
    }
    foreach (MetaModel::EnumReferencingClasses($sClass) as $sRemoteClass => $aRemoteKeys) {
        foreach ($aRemoteKeys as $sExtKeyAttCode => $oExtKeyAttDef) {
            $sVisited = array_key_exists($sRemoteClass, $aVisitedClasses) ? " ..." : "";
            $oPage->add("<li>{$sClass}| &lt;=" . MakeClassHLink($sRemoteClass, $sContext) . "::<em>{$sExtKeyAttCode}</em>{$sVisited}</li>\n");
            DisplayRelatedClassesBestInClass($oPage, $sRemoteClass, $iLevels, $aVisitedClasses, true, $sContext);
        }
    }
    ////$oPage->add("</div>");
    if ($bSubtree) {
        $oPage->add("</ul>\n");
    }
}
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:39,代码来源:schema.php

示例2: GetReferencingObjects

 public function GetReferencingObjects($bAllowAllData = false)
 {
     $aDependentObjects = array();
     $aRererencingMe = MetaModel::EnumReferencingClasses(get_class($this));
     foreach ($aRererencingMe as $sRemoteClass => $aExtKeys) {
         foreach ($aExtKeys as $sExtKeyAttCode => $oExtKeyAttDef) {
             // skip if this external key is behind an external field
             if (!$oExtKeyAttDef->IsExternalKey(EXTKEY_ABSOLUTE)) {
                 continue;
             }
             $oSearch = new DBObjectSearch($sRemoteClass);
             $oSearch->AddCondition($sExtKeyAttCode, $this->GetKey(), '=');
             if ($bAllowAllData) {
                 $oSearch->AllowAllData();
             }
             $oSet = new CMDBObjectSet($oSearch);
             if ($oSet->Count() > 0) {
                 $aDependentObjects[$sRemoteClass][$sExtKeyAttCode] = array('attribute' => $oExtKeyAttDef, 'objects' => $oSet);
             }
         }
     }
     return $aDependentObjects;
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:23,代码来源:dbobject.class.php

示例3: test_linksinfo

 function test_linksinfo()
 {
     echo "<h4>Enum links</h4>";
     self::DumpVariable(MetaModel::EnumReferencedClasses("cmdbTeam"));
     self::DumpVariable(MetaModel::EnumReferencingClasses("Organization"));
     self::DumpVariable(MetaModel::EnumLinkingClasses());
     self::DumpVariable(MetaModel::EnumLinkingClasses("cmdbContact"));
     self::DumpVariable(MetaModel::EnumLinkingClasses("cmdWorkshop"));
     self::DumpVariable(MetaModel::GetLinkLabel("Liens_entre_contacts_et_workshop", "toworkshop"));
 }
开发者ID:besmirzanaj,项目名称:itop-code,代码行数:10,代码来源:testlist.inc.php


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