本文整理汇总了PHP中OCP\Files\Folder::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getId方法的具体用法?PHP Folder::getId怎么用?PHP Folder::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\Files\Folder
的用法示例。
在下文中一共展示了Folder::getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSharesBy
/**
* Get all shares by the given user. Sharetype and path can be used to filter.
*
* @param string $userId
* @param int $shareType
* @param \OCP\Files\File|\OCP\Files\Folder $node
* @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator
* @param int $limit The maximum number of shares to be returned, -1 for all shares
* @param int $offset
* @return Share[]
*/
public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset)
{
$qb = $this->dbConn->getQueryBuilder();
$qb->select('*')->from('share');
$qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter($shareType)));
/**
* Reshares for this user are shares where they are the owner.
*/
if ($reshares === false) {
//Special case for old shares created via the web UI
$or1 = $qb->expr()->andX($qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)), $qb->expr()->isNull('uid_initiator'));
$qb->andWhere($qb->expr()->orX($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)), $or1));
} else {
$qb->andWhere($qb->expr()->orX($qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)), $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))));
}
if ($node !== null) {
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
}
if ($limit !== -1) {
$qb->setMaxResults($limit);
}
$qb->setFirstResult($offset);
$qb->orderBy('id');
$cursor = $qb->execute();
$shares = [];
while ($data = $cursor->fetch()) {
$shares[] = $this->createShare($data);
}
$cursor->closeCursor();
return $shares;
}