mirror of
https://github.com/predis/predis.git
synced 2026-08-28 03:02:04 +00:00
7c0cc7bdbe
* Refactored zinterstore, zunionstore commands and command traits * Merge conflicts resolve, update cluster strategy test with new arguments * Updated assertion in case if command executed faster then duration minimal threshold * Updated Limit trait to handle integer values * Updated Limit trait to return previous arguments if limit argument isn't set * Added support for ZINTERCARD command Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
40 lines
864 B
PHP
40 lines
864 B
PHP
<?php
|
|
|
|
namespace Predis\Command\Redis;
|
|
|
|
use Predis\Command\Command as RedisCommand;
|
|
use Predis\Command\Traits\Keys;
|
|
use Predis\Command\Traits\Limit;
|
|
|
|
/**
|
|
* @link https://redis.io/commands/zintercard/
|
|
*
|
|
* This command is similar to ZINTER, but instead of returning the result set,
|
|
* it returns just the cardinality of the result.
|
|
*/
|
|
class ZINTERCARD extends RedisCommand
|
|
{
|
|
use Keys {
|
|
Keys::setArguments as setKeys;
|
|
}
|
|
use Limit {
|
|
Limit::setArguments as setLimit;
|
|
}
|
|
|
|
protected static $keysArgumentPositionOffset = 0;
|
|
protected static $limitArgumentPositionOffset = 1;
|
|
|
|
public function getId()
|
|
{
|
|
return 'ZINTERCARD';
|
|
}
|
|
|
|
public function setArguments(array $arguments)
|
|
{
|
|
$this->setLimit($arguments);
|
|
$arguments = $this->getArguments();
|
|
|
|
$this->setKeys($arguments);
|
|
}
|
|
}
|