ShareWrapperService
in package
Uses
TStringTools, TDeserialize
Class ShareWrapperService
Table of Contents
- CACHE_SHARED_WITH = 'circles/getSharedWith'
- CACHE_SHARED_WITH_TTL = 900
- $cache : ICache
- $shareWrapperRequest : ShareWrapperRequest
- __construct() : mixed
- ShareWrapperService constructor.
- clearCache() : void
- delete() : void
- deleteAllSharesToCircle() : void
- deleteUserSharesToCircle() : void
- deserialize() : IDeserializable
- deserializeArray() : array<string|int, IDeserializable>
- deserializeJson() : IDeserializable
- deserializeList() : array<string|int, IDeserializable>
- generateRandomSentence() : string
- generateRandomWord() : string
- getChild() : ShareWrapper
- getDateDiff() : string
- getShareById() : ShareWrapper
- getShareByToken() : ShareWrapper
- getSharedWith() : array<string|int, ShareWrapper>
- getSharesBy() : array<string|int, ShareWrapper>
- getSharesByFileId() : array<string|int, ShareWrapper>
- getSharesInFolder() : array<string|int, ShareWrapper>
- getSharesToCircle() : array<string|int, ShareWrapper>
- humanReadable() : string
- save() : void
- searchShare() : ShareWrapper
- serialize() : array<string|int, mixed>
- serializeArray() : array<string|int, mixed>
- update() : void
- commonPart() : string
- cut() : string
- feedStringWithParams() : string
- isUuid() : bool
- token() : string
- uuid() : string
- Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
- createChild() : ShareWrapper
- generateSharedWithCacheKey() : string
Constants
CACHE_SHARED_WITH
public
mixed
CACHE_SHARED_WITH
= 'circles/getSharedWith'
CACHE_SHARED_WITH_TTL
public
mixed
CACHE_SHARED_WITH_TTL
= 900
Properties
$cache
private
ICache
$cache
$shareWrapperRequest
private
ShareWrapperRequest
$shareWrapperRequest
Methods
__construct()
ShareWrapperService constructor.
public
__construct(ICacheFactory $cacheFactory, ShareWrapperRequest $shareWrapperRequest) : mixed
Parameters
- $cacheFactory : ICacheFactory
- $shareWrapperRequest : ShareWrapperRequest
Return values
mixed —clearCache()
public
clearCache(string $singleId) : void
Parameters
- $singleId : string
Return values
void —delete()
public
delete(ShareWrapper $shareWrapper) : void
Parameters
- $shareWrapper : ShareWrapper
Return values
void —deleteAllSharesToCircle()
public
deleteAllSharesToCircle(string $circleId) : void
Parameters
- $circleId : string
Return values
void —deleteUserSharesToCircle()
public
deleteUserSharesToCircle(string $circleId, string $userId) : void
Parameters
- $circleId : string
- $userId : string
Tags
Return values
void —deserialize()
public
deserialize(array<string|int, mixed> $data, string $class) : IDeserializable
Parameters
- $data : array<string|int, mixed>
- $class : string
Tags
Return values
IDeserializable —deserializeArray()
public
deserializeArray(array<string|int, mixed> $data, string $class[, bool $associative = false ]) : array<string|int, IDeserializable>
Parameters
- $data : array<string|int, mixed>
- $class : string
- $associative : bool = false
Return values
array<string|int, IDeserializable> —deserializeJson()
public
deserializeJson(string $json, string $class) : IDeserializable
Parameters
- $json : string
- $class : string
Tags
Return values
IDeserializable —deserializeList()
public
deserializeList(string $json, string $class) : array<string|int, IDeserializable>
Parameters
- $json : string
- $class : string
Tags
Return values
array<string|int, IDeserializable> —generateRandomSentence()
public
generateRandomSentence([int $words = 5 ]) : string
Parameters
- $words : int = 5
Return values
string —generateRandomWord()
public
generateRandomWord([int $length = 8 ]) : string
Parameters
- $length : int = 8
Return values
string —getChild()
public
getChild(IShare $share, FederatedUser $federatedUser) : ShareWrapper
Parameters
- $share : IShare
- $federatedUser : FederatedUser
Tags
Return values
ShareWrapper —getDateDiff()
public
getDateDiff(int $first, int $second[, bool $short = false ][, array<string|int, mixed> $words = [] ]) : string
Parameters
- $first : int
- $second : int
- $short : bool = false
- $words : array<string|int, mixed> = []
Tags
Return values
string —getShareById()
public
getShareById(int $shareId[, FederatedUser|null $federatedUser = null ]) : ShareWrapper
Parameters
- $shareId : int
- $federatedUser : FederatedUser|null = null
Tags
Return values
ShareWrapper —getShareByToken()
public
getShareByToken(string $token[, FederatedUser|null $federatedUser = null ]) : ShareWrapper
Parameters
- $token : string
- $federatedUser : FederatedUser|null = null
Tags
Return values
ShareWrapper —getSharedWith()
public
getSharedWith(FederatedUser $federatedUser, int $nodeId, CircleProbe|null $probe) : array<string|int, ShareWrapper>
Parameters
- $federatedUser : FederatedUser
- $nodeId : int
- $probe : CircleProbe|null
Tags
Return values
array<string|int, ShareWrapper> —getSharesBy()
public
getSharesBy(FederatedUser $federatedUser, int $nodeId, bool $reshares, int $limit, int $offset[, bool $getData = false ][, bool $completeDetails = false ]) : array<string|int, ShareWrapper>
Parameters
- $federatedUser : FederatedUser
- $nodeId : int
- $reshares : bool
- $limit : int
- $offset : int
- $getData : bool = false
- $completeDetails : bool = false
Tags
Return values
array<string|int, ShareWrapper> —getSharesByFileId()
public
getSharesByFileId(int $fileId[, bool $getData = false ]) : array<string|int, ShareWrapper>
Parameters
- $fileId : int
- $getData : bool = false
Tags
Return values
array<string|int, ShareWrapper> —getSharesInFolder()
public
getSharesInFolder(FederatedUser $federatedUser, Folder $node, bool $reshares[, bool $shallow = true ]) : array<string|int, ShareWrapper>
Parameters
- $federatedUser : FederatedUser
- $node : Folder
- $reshares : bool
- $shallow : bool = true
-
Whether the method should stop at the first level, or look into sub-folders.
Tags
Return values
array<string|int, ShareWrapper> —getSharesToCircle()
public
getSharesToCircle(string $circleId[, FederatedUser|null $shareRecipient = null ][, FederatedUser|null $shareInitiator = null ][, bool $completeDetails = false ]) : array<string|int, ShareWrapper>
Parameters
- $circleId : string
- $shareRecipient : FederatedUser|null = null
- $shareInitiator : FederatedUser|null = null
- $completeDetails : bool = false
Tags
Return values
array<string|int, ShareWrapper> —humanReadable()
public
humanReadable(int $bytes) : string
Parameters
- $bytes : int
Return values
string —save()
public
save(IShare $share) : void
Parameters
- $share : IShare
Tags
Return values
void —searchShare()
public
searchShare(string $singleId, int $nodeId) : ShareWrapper
Parameters
- $singleId : string
- $nodeId : int
Tags
Return values
ShareWrapper —serialize()
public
serialize(JsonSerializable $model) : array<string|int, mixed>
Parameters
- $model : JsonSerializable
Return values
array<string|int, mixed> —serializeArray()
public
serializeArray(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —update()
public
update(ShareWrapper $shareWrapper) : void
Parameters
- $shareWrapper : ShareWrapper
Return values
void —commonPart()
protected
commonPart(string $str1, string $str2[, bool $cs = true ]) : string
Parameters
- $str1 : string
- $str2 : string
- $cs : bool = true
-
case sensitive ?
Return values
string —cut()
protected
cut(string $line, int $length) : string
Parameters
- $line : string
- $length : int
Return values
string —feedStringWithParams()
protected
feedStringWithParams(string $line, array<string|int, mixed> $params) : string
Parameters
- $line : string
- $params : array<string|int, mixed>
Return values
string —isUuid()
protected
isUuid(string $uuid) : bool
Parameters
- $uuid : string
Return values
bool —token()
protected
token([int $length = 15 ]) : string
Parameters
- $length : int = 15
Return values
string —uuid()
Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
protected
uuid(int $length) : string
Parameters
- $length : int
Return values
string —createChild()
private
createChild(IShare $share, FederatedUser $federatedUser) : ShareWrapper
Parameters
- $share : IShare
- $federatedUser : FederatedUser
Tags
Return values
ShareWrapper —generateSharedWithCacheKey()
private
generateSharedWithCacheKey(FederatedUser $federatedUser, int $nodeId, string $probeSum) : string
Parameters
- $federatedUser : FederatedUser
- $nodeId : int
- $probeSum : string