/
merexo
/
rediska
Обзор
Документация
Войти
/
merexo
/
rediska
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Parts/Set.php
71 строка
1 KB
Ilya
+ Set
19 окт 2021, 23:02
19 окт 2021, 23:02
b1e5d64
Код
Авторство
О чём код?
<?php namespace Merexo\Rediska\Parts; class Set extends RedisPart { private $set_key; public function __construct(\Redis $redis, $set_key) { parent::__construct($redis); $this->set_key = $set_key; } /** * @param $value */ public function add(...$value) { $this->redis->sAdd($this->set_key, ...$value); } /** * @param $value */ public function remove(...$value) { $this->redis->sRem($this->set_key, ...$value); } /** * @return array */ public function getAll() { return $this->redis->sMembers($this->set_key); } /** * @return array|bool|mixed|string */ public function pop() { return $this->redis->sPop($this->set_key); } /** * @return int */ public function len() { return $this->redis->sCard($this->set_key); } /** * @param $value * @return bool */ public function isMember($value) { return $this->redis->sIsMember($this->set_key, $value); } /** * @return int */ public function drop() { return $this->redis->del($this->set_key); } }