Predis\Client::getIterator PHP 메소드

getIterator() 공개 메소드

public getIterator ( )
    public function getIterator()
    {
        $clients = array();
        $connection = $this->getConnection();
        if (!$connection instanceof \Traversable) {
            throw new ClientException('The underlying connection is not traversable');
        }
        foreach ($connection as $node) {
            $clients[(string) $node] = new static($node, $this->getOptions());
        }
        return new \ArrayIterator($clients);
    }