本文整理汇总了PHP中AJXP_Node::copyOrMoveMetadataFromNode方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Node::copyOrMoveMetadataFromNode方法的具体用法?PHP AJXP_Node::copyOrMoveMetadataFromNode怎么用?PHP AJXP_Node::copyOrMoveMetadataFromNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Node
的用法示例。
在下文中一共展示了AJXP_Node::copyOrMoveMetadataFromNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleNodeChange
/**
* @param AJXP_Node $fromNode
* @param AJXP_Node $toNode
* @param bool $copy
*/
public function handleNodeChange($fromNode = null, $toNode = null, $copy = false)
{
if ($fromNode == null) {
return;
}
if ($toNode == null) {
$fromNode->removeMetadata("etherpad", AJXP_METADATA_ALLUSERS, AJXP_METADATA_SCOPE_GLOBAL, false);
} else {
if (!$copy) {
$toNode->copyOrMoveMetadataFromNode($fromNode, "etherpad", "move", AJXP_METADATA_ALLUSERS, AJXP_METADATA_SCOPE_GLOBAL, false);
}
}
}
示例2: nodeChangeBookmarkMetadata
/**
* @param AJXP_Node $fromNode
* @param AJXP_Node $toNode
* @param bool $copy
*/
public function nodeChangeBookmarkMetadata($fromNode = null, $toNode = null, $copy = false)
{
if ($copy || $fromNode == null) {
return;
}
$user = AuthService::getLoggedUser();
if ($user == null) {
return;
}
if (!isset(self::$loadedBookmarks)) {
self::$loadedBookmarks = $user->getBookmarks();
}
if ($toNode == null) {
$fromNode->removeMetadata("ajxp_bookmarked", true, AJXP_METADATA_SCOPE_REPOSITORY, true);
} else {
$toNode->copyOrMoveMetadataFromNode($fromNode, "ajxp_bookmarked", "move", true, AJXP_METADATA_SCOPE_REPOSITORY, true);
}
AJXP_Controller::applyHook("msg.instant", array("<reload_bookmarks/>", $fromNode->getRepositoryId(), AuthService::getLoggedUser()->getId()));
}