當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。