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