本文整理匯總了PHP中eZContentObjectTreeNode::findMainNode方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObjectTreeNode::findMainNode方法的具體用法?PHP eZContentObjectTreeNode::findMainNode怎麽用?PHP eZContentObjectTreeNode::findMainNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObjectTreeNode
的用法示例。
在下文中一共展示了eZContentObjectTreeNode::findMainNode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mainNode
/**
* Returns the main node id for the current object.
*
* @return int|null
*/
function mainNode()
{
return eZContentObjectTreeNode::findMainNode( $this->attribute( 'id' ), true );
}
示例2: updateFromParent
/**
* Update current empty paex fields with values get from paex object of
* parent of current main node.
*
* @param bool $forceUpdate
* @return true
*/
function updateFromParent($forceUpdate = false)
{
$mainNode = eZContentObjectTreeNode::findMainNode($this->attribute('contentobject_id'), true);
if (!is_object($mainNode)) {
eZDebug::writeDebug('mainNode not found', 'eZPaEx::updateFromParent');
} elseif ($mainNode->attribute('depth') > 1) {
$parentMainNodeID = $mainNode->attribute('parent_node_id');
$parentContentObject = eZContentObject::fetchByNodeID($parentMainNodeID);
$parentPaex = eZPaEx::getPaEx($parentContentObject->attribute('id'));
if ($parentPaex instanceof eZPaEx) {
$paexUpdated = false;
if (!$this->hasRegexp() || $forceUpdate) {
$this->setAttribute('passwordvalidationregexp', $parentPaex->attribute('passwordvalidationregexp'));
$paexUpdated = true;
}
if (!$this->hasLifeTime() || $forceUpdate) {
$this->setAttribute('passwordlifetime', $parentPaex->attribute('passwordlifetime'));
$paexUpdated = true;
}
if (!$this->hasNotification() || $forceUpdate) {
$this->setAttribute('expirationnotification', $parentPaex->attribute('expirationnotification'));
$paexUpdated = true;
}
if ($paexUpdated) {
eZDebug::writeDebug('Paex updated from parent', 'eZPaEx::updateFromParent');
$this->store();
}
}
}
return true;
}