* @inheritdoc
*/
public function setSharedWith($sharedWith) {
+ if (!is_string($sharedWith)) {
+ throw new \InvalidArgumentException();
+ }
$this->sharedWith = $sharedWith;
return $this;
}
* @inheritdoc
*/
public function setSharedBy($sharedBy) {
+ if (!is_string($sharedBy)) {
+ throw new \InvalidArgumentException();
+ }
//TODO checks
$this->sharedBy = $sharedBy;
* @inheritdoc
*/
public function setShareOwner($shareOwner) {
+ if (!is_string($shareOwner)) {
+ throw new \InvalidArgumentException();
+ }
//TODO checks
$this->shareOwner = $shareOwner;
/**
* Set the receiver of this share.
*
- * @param IUser|IGroup
+ * @param string $sharedWith
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
/**
* Get the receiver of this share.
*
- * @return IUser|IGroup
+ * @return string
* @since 9.0.0
*/
public function getSharedWith();
/**
* Set the sharer of the path.
*
- * @param IUser $sharedBy
+ * @param string $sharedBy
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
/**
* Get share sharer
*
- * @return IUser
+ * @return string
* @since 9.0.0
*/
public function getSharedBy();
/**
* Set the original share owner (who owns the path that is shared)
*
- * @param IUser
+ * @param string $shareOwner
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
/**
* Get the original share owner (who owns the path that is shared)
*
- * @return IUser
+ * @return string
* @since 9.0.0
*/
public function getShareOwner();
* share from their self then the original group share should still exist.
*
* @param \OCP\Share\IShare $share
- * @param IUser $recipient
+ * @param string $recipient UserId of the recipient
* @since 9.0.0
*/
- public function deleteFromSelf(\OCP\Share\IShare $share, IUser $recipient);
+ public function deleteFromSelf(\OCP\Share\IShare $share, $recipient);
/**
* Move a share as a recipient.
* the target should only be changed for them.
*
* @param \OCP\Share\IShare $share
- * @param IUser $recipient
+ * @param string $recipient userId of recipient
* @return \OCP\Share\IShare
* @since 9.0.0
*/
- public function move(\OCP\Share\IShare $share, IUser $recipient);
+ public function move(\OCP\Share\IShare $share, $recipient);
/**
* Get all shares by the given user
*
- * @param IUser $user
+ * @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 \OCP\Share\I Share[]
+ * @return \OCP\Share\IShare Share[]
* @since 9.0.0
*/
- public function getSharesBy(IUser $user, $shareType, $node, $reshares, $limit, $offset);
+ public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset);
/**
* Get share by id
*
* @param int $id
- * @param IUser|null $recipient
+ * @param string|null $recipientId
* @return \OCP\Share\IShare
* @throws ShareNotFound
* @since 9.0.0
*/
- public function getShareById($id, $recipient = null);
+ public function getShareById($id, $recipientId = null);
/**
* Get shares for a given path
/**
* Get shared with the given user
*
- * @param IUser $user get shares where this user is the recipient
+ * @param stromg $userId get shares where this user is the recipient
* @param int $shareType
* @param Node|null $node
* @param int $limit The max number of entries returned, -1 for all
* @return \OCP\Share\IShare[]
* @since 9.0.0
*/
- public function getSharedWith(IUser $user, $shareType, $node, $limit, $offset);
+ public function getSharedWith($userId, $shareType, $node, $limit, $offset);
/**
* Get a share by token