本文整理汇总了PHP中umiHierarchy::getElement方法的典型用法代码示例。如果您正苦于以下问题:PHP umiHierarchy::getElement方法的具体用法?PHP umiHierarchy::getElement怎么用?PHP umiHierarchy::getElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umiHierarchy
的用法示例。
在下文中一共展示了umiHierarchy::getElement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: systemWhoLocked
public function systemWhoLocked($element_id)
{
$ePage = umiHierarchy::getElement($element_id);
$oPage = $ePage->getObject();
return $oPage->getValue("lock_user");
}
示例2: placeComments
/**
* @desc
*/
private function placeComments($parentId, $templateString, umiHierarchy $hierarchy, $commentHType, &$total)
{
static $postHType = 0;
if (!$postHType) {
$postHType = umiHierarchyTypesCollection::getInstance()->getTypeByName('blogs20', 'post')->getId();
}
$parent = $hierarchy->getElement($parentId, true);
if (!$parent instanceof umiHierarchyElement) {
throw new publicException("Unknown parent element for comments");
}
$rootComments = $parent->getTypeId() == $postHType;
$sel = new selector('pages');
$sel->where('hierarchy')->page($parentId)->childs(1);
$sel->types('hierarchy-type')->id($commentHType);
$sel->where('is_spam')->notequals(1);
if ($rootComments) {
$page = (int) getRequest('p');
$sel->limit($page * $this->comments_per_page, $this->comments_per_page);
}
$result = $sel->result();
$total = $sel->length();
$aLines = array();
foreach ($result as $oComment) {
$commentId = $oComment->getId();
$temp = 0;
$pubTime = $oComment->getValue('publish_time');
$aLineParam = array();
$aLineParam['attribute:cid'] = $commentId;
$aLineParam['name'] = $oComment->getName();
$aLineParam['content'] = $this->prepareContent($oComment->getValue('content'));
$aLineParam['author_id'] = $oComment->getValue('author_id');
$aLineParam['publish_time'] = $pubTime instanceof umiDate ? $pubTime->getFormattedDate('U') : time();
$aLineParam['subnodes:subcomments'] = $this->placeComments($commentId, $templateString, $hierarchy, $commentHType, $temp);
$aLines[] = self::parseTemplate($templateString, $aLineParam, $commentId);
}
return $aLines;
}