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


PHP MetaModel::GetParentPersistentClass方法代码示例

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


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

示例1: DisplaySubclasses

/**
 * Helper for the global list and the details of a given class
 */
function DisplaySubclasses($oPage, $sClass, $sContext)
{
    $aChildClasses = MetaModel::EnumChildClasses($sClass);
    if (count($aChildClasses) != 0) {
        $oPage->add("<ul>\n");
        $aOrderedClasses = array();
        foreach ($aChildClasses as $sClassName) {
            // Skip indirect childs, they will be handled somewhere else
            if (MetaModel::GetParentPersistentClass($sClassName) == $sClass) {
                $aOrderedClasses[$sClassName] = MetaModel::GetName($sClassName);
            }
        }
        // Sort on the display name
        asort($aOrderedClasses);
        foreach ($aOrderedClasses as $sClassName => $sDisplayName) {
            // Skip indirect childs, they will be handled somewhere else
            if (MetaModel::GetParentPersistentClass($sClassName) == $sClass) {
                $oPage->add("<li class=\"open\">" . MakeClassHLink($sClassName, $sContext) . "\n");
                DisplaySubclasses($oPage, $sClassName, $sContext);
                $oPage->add("</li>\n");
            }
        }
        $oPage->add("</ul>\n");
    }
}
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:28,代码来源:schema.php

示例2: GetClassActionGrant

 public function GetClassActionGrant($iProfile, $sClass, $sAction)
 {
     if (isset($this->m_aClassActionGrants[$iProfile][$sClass][$sAction])) {
         return $this->m_aClassActionGrants[$iProfile][$sClass][$sAction];
     }
     // Get the permission for this profile/class/action
     $oSearch = DBObjectSearch::FromOQL_AllData("SELECT URP_ActionGrant WHERE class = :class AND action = :action AND profileid = :profile AND permission = 'yes'");
     $oSet = new DBObjectSet($oSearch, array(), array('class' => $sClass, 'action' => $sAction, 'profile' => $iProfile));
     if ($oSet->Count() >= 1) {
         $oGrantRecord = $oSet->Fetch();
     } else {
         $sParentClass = MetaModel::GetParentPersistentClass($sClass);
         if (empty($sParentClass)) {
             $oGrantRecord = null;
         } else {
             $oGrantRecord = $this->GetClassActionGrant($iProfile, $sParentClass, $sAction);
         }
     }
     $this->m_aClassActionGrants[$iProfile][$sClass][$sAction] = $oGrantRecord;
     return $oGrantRecord;
 }
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:21,代码来源:userrightsprojection.class.inc.php

示例3: GetProfileActionGrant

 public function GetProfileActionGrant($iProfile, $sClass, $sAction)
 {
     $this->LoadActionGrantCache();
     // Note: action is forced lowercase to be more flexible (historical bug)
     $sAction = strtolower($sAction);
     if (isset($this->m_aClassActionGrants[$iProfile][$sClass][$sAction])) {
         return $this->m_aClassActionGrants[$iProfile][$sClass][$sAction];
     }
     // Recursively look for the grant record in the class hierarchy
     $sParentClass = MetaModel::GetParentPersistentClass($sClass);
     if (empty($sParentClass)) {
         $iGrant = null;
     } else {
         // Recursively look for the grant record in the class hierarchy
         $iGrant = $this->GetProfileActionGrant($iProfile, $sParentClass, $sAction);
     }
     $this->m_aClassActionGrants[$iProfile][$sClass][$sAction] = $iGrant;
     return $iGrant;
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:19,代码来源:userrightsprofile.db.class.inc.php


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