PHP Class Sokil\Mongo\Cache

Inheritance: implements Countable
Show file Open project: sokil/php-mongo Class Usage Examples

Public Methods

Method Description
__construct ( Database $database, $collectionName )
clear ( )
count ( )
delete ( $key )
deleteMatchingAllTags ( array $tags ) Delete documents by tag Document deletes if it contains all passed tags
deleteMatchingAnyTag ( array $tags ) Delete documents by tag Document deletes if it contains any of passed tags
deleteMatchingNoneOfTags ( array $tags ) Delete documents by tag Document deletes if it not contains all passed tags
deleteMatchingTag ( $tag ) Delete documents by tag
deleteNotMatchingAnyTag ( array $tags ) Delete documents by tag Document deletes if it contains any of passed tags
deleteNotMatchingTag ( $tag ) Delete documents by tag
get ( $key ) : array | null Get value by key
has ( $key )
init ( )
set ( integer | string $key, mixed $value, integer $ttl, array $tags = null ) Set with expiration in seconds
setDueDate ( integer | string $key, mixed $value, integer $timestamp, array $tags = null ) Set with expiration on concrete date
setNeverExpired ( integer | string $key, mixed $value, array $tags = null ) : Cache Set key that never expired

Method Details

__construct() public method

public __construct ( Database $database, $collectionName )
$database Database

clear() public method

public clear ( )

count() public method

public count ( )

delete() public method

public delete ( $key )

deleteMatchingAllTags() public method

Delete documents by tag Document deletes if it contains all passed tags
public deleteMatchingAllTags ( array $tags )
$tags array

deleteMatchingAnyTag() public method

Delete documents by tag Document deletes if it contains any of passed tags
public deleteMatchingAnyTag ( array $tags )
$tags array

deleteMatchingNoneOfTags() public method

Delete documents by tag Document deletes if it not contains all passed tags
public deleteMatchingNoneOfTags ( array $tags )
$tags array

deleteMatchingTag() public method

Delete documents by tag
public deleteMatchingTag ( $tag )

deleteNotMatchingAnyTag() public method

Delete documents by tag Document deletes if it contains any of passed tags
public deleteNotMatchingAnyTag ( array $tags )
$tags array

deleteNotMatchingTag() public method

Delete documents by tag
public deleteNotMatchingTag ( $tag )

get() public method

Get value by key
public get ( $key ) : array | null
$key
return array | null

has() public method

public has ( $key )

init() public method

public init ( )

set() public method

Set with expiration in seconds
public set ( integer | string $key, mixed $value, integer $ttl, array $tags = null )
$key integer | string
$value mixed
$ttl integer
$tags array

setDueDate() public method

Set with expiration on concrete date
public setDueDate ( integer | string $key, mixed $value, integer $timestamp, array $tags = null )
$key integer | string
$value mixed
$timestamp integer
$tags array

setNeverExpired() public method

Set key that never expired
public setNeverExpired ( integer | string $key, mixed $value, array $tags = null ) : Cache
$key integer | string
$value mixed
$tags array
return Cache