本文整理汇总了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> =>" . 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}| <=" . 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");
}
}
示例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;
}
示例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"));
}