本文整理匯總了PHP中false::hasWatchOnNode方法的典型用法代碼示例。如果您正苦於以下問題:PHP false::hasWatchOnNode方法的具體用法?PHP false::hasWatchOnNode怎麽用?PHP false::hasWatchOnNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類false
的用法示例。
在下文中一共展示了false::hasWatchOnNode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: toJson
/**
* @param MetaWatchRegister|false $watcher
* @param ShareRightsManager $rightsManager
* @param PublicAccessManager $publicAccessManager
* @param array $messages
* @return array|false
*/
public function toJson($watcher, $rightsManager, $publicAccessManager, $messages)
{
$repoRootNode = new AJXP_Node("pydio://" . $this->getRepositoryId() . "/");
$elementWatch = false;
if ($watcher != false) {
$elementWatch = $watcher->hasWatchOnNode($repoRootNode, AuthService::getLoggedUser()->getId(), MetaWatchRegister::$META_WATCH_NAMESPACE);
}
$sharedEntries = $rightsManager->computeSharedRepositoryAccessRights($this->getRepositoryId(), true, $repoRootNode);
if (empty($sharedEntries)) {
return false;
}
$cFilter = $this->getRepository()->getContentFilter();
if (!empty($cFilter)) {
$cFilter = $cFilter->toArray();
}
$jsonData = array("repositoryId" => $this->getRepositoryId(), "users_number" => AuthService::countUsersForRepository($this->getRepositoryId()), "label" => $this->getRepository()->getDisplay(), "description" => $this->getRepository()->getDescription(), "entries" => $sharedEntries, "element_watch" => $elementWatch, "repository_url" => AJXP_Utils::getWorkspaceShortcutURL($this->getRepository()) . "/", "content_filter" => $cFilter, "share_owner" => $this->getOwner(), "share_scope" => $this->getVisibilityScope());
$jsonData["links"] = array();
foreach ($this->shareLinks as $shareLink) {
$uniqueUser = $shareLink->getUniqueUser();
$found = false;
foreach ($sharedEntries as $entry) {
if ($entry["ID"] == $uniqueUser) {
$found = true;
}
}
if (!$found) {
// STRANGE, THE ASSOCIATED USER IS MISSING
error_log("Found shareLink orphan with uniqueUser " . $uniqueUser);
continue;
}
$jsonData["links"][$shareLink->getHash()] = $shareLink->getJsonData($publicAccessManager, $messages);
}
return $jsonData;
}