本文整理汇总了PHP中OC\Share\Share::getSharedItemsOwners方法的典型用法代码示例。如果您正苦于以下问题:PHP Share::getSharedItemsOwners方法的具体用法?PHP Share::getSharedItemsOwners怎么用?PHP Share::getSharedItemsOwners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Share\Share
的用法示例。
在下文中一共展示了Share::getSharedItemsOwners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
* @param string $user The user whose data the object will operate on.
* @param string $type The type of items for which tags will be loaded.
* @param array $defaultTags Tags that should be created at construction.
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
*/
public function __construct(TagMapper $mapper, $user, $type, $defaultTags = array(), $includeShared = false)
{
$this->mapper = $mapper;
$this->user = $user;
$this->type = $type;
$this->includeShared = $includeShared;
$this->owners = array($this->user);
if ($this->includeShared) {
$this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
$this->backend = \OC\Share\Share::getBackend($this->type);
}
$this->tags = $this->mapper->loadTags($this->owners, $this->type);
if (count($defaultTags) > 0 && count($this->tags) === 0) {
$this->addMultiple($defaultTags, true);
}
\OCP\Util::writeLog('core', __METHOD__ . ', tags: ' . print_r($this->tags, true), \OCP\Util::DEBUG);
}
示例2: __construct
/**
* Constructor.
*
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
* @param string $user The user whose data the object will operate on.
* @param string $type The type of items for which tags will be loaded.
* @param array $defaultTags Tags that should be created at construction.
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
*/
public function __construct(TagMapper $mapper, $user, $type, $defaultTags = array(), $includeShared = false)
{
$this->mapper = $mapper;
$this->user = $user;
$this->type = $type;
$this->includeShared = $includeShared;
$this->owners = array($this->user);
if ($this->includeShared) {
$this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
$this->backend = \OC\Share\Share::getBackend($this->type);
}
$this->tags = $this->mapper->loadTags($this->owners, $this->type);
if (count($defaultTags) > 0 && count($this->tags) === 0) {
$this->addMultiple($defaultTags, true);
}
}