Пример #1
0
 public function testUnionStore()
 {
     $a = new Set('SetA');
     $a->setClient($this->getRedisClient());
     $a->add(array(1, 2, 3, 4));
     $b = new Set('SetB');
     $b->setClient($this->getRedisClient());
     $b->add(array(3, 4, 5, 6, 7, 8));
     $destination = 'SetC';
     $total = $a->unionStore($destination, $b);
     $this->assertEquals(8, $total);
     $c = new Set('SetC');
     $c->setClient($this->getRedisClient());
     $this->assertEquals(array(1, 2, 3, 4, 5, 6, 7, 8), $c->elements());
 }
Пример #2
0
 public function unionStore($destination, Set $set)
 {
     return $this->client->sunionstore($destination, $this->getKey(), $set->getKey());
 }