Base
in package
AbstractYes
Basic class for all available data from TikTok
Table of Contents
Properties
- $caching_mode : CachingMode
- Enable caching for Item
- $cursor : mixed
- $feed : Feed
- $info : Info
- $sender : Sender
- $term : string
- $cache : Cache
- $type : string
Methods
- __construct() : mixed
- __destruct() : mixed
- Destruct function, handles cache
- error() : Meta
- Get Meta from feed if $this->feed has been called, info if not
- feedOk() : bool
- Checks if feed request went ok
- getFeed() : Feed|null
- Returns feed, returns null if $this->feed has not been called
- getFull() : Full
- getInfo() : Info
- infoOk() : bool
- Checks if info request went OK
- ok() : bool
- Checks if both info and feed requests went ok
- handleFeedCache() : bool
- Checks if cache exists and sets the value of `$this->feed`
- getCacheKey() : string
- Builds cache key from type (video, tag...) and key (id of user, hashtag name...)
Properties
$caching_mode
Enable caching for Item
protected
CachingMode
$caching_mode
= \TikScraper\Constants\CachingMode::FULL
$cursor
protected
mixed
$cursor
$feed
protected
Feed
$feed
$info
protected
Info
$info
$sender
protected
Sender
$sender
$term
protected
string
$term
$cache
private
Cache
$cache
$type
private
string
$type
Methods
__construct()
public
__construct(string $term, string $type, Sender $sender, Cache $cache) : mixed
Parameters
__destruct()
Destruct function, handles cache
public
__destruct() : mixed
error()
Get Meta from feed if $this->feed has been called, info if not
public
error() : Meta
Return values
MetafeedOk()
Checks if feed request went ok
public
feedOk() : bool
Return values
boolgetFeed()
Returns feed, returns null if $this->feed has not been called
public
getFeed() : Feed|null
Return values
Feed|nullgetFull()
public
getFull() : Full
Return values
FullgetInfo()
public
getInfo() : Info
Return values
InfoinfoOk()
Checks if info request went OK
public
infoOk() : bool
Return values
boolok()
Checks if both info and feed requests went ok
public
ok() : bool
Return values
boolhandleFeedCache()
Checks if cache exists and sets the value of `$this->feed`
protected
handleFeedCache() : bool
Return values
bool —Exists?
getCacheKey()
Builds cache key from type (video, tag...) and key (id of user, hashtag name...)
private
getCacheKey([bool $addCursor = false ]) : string
Parameters
- $addCursor : bool = false
-
Add current cursor to key