lib/CosmoW/Riak/Collection.php
public function distinct($field, array $query = array(), array $options = array())
    {
        if ($this->eventManager->hasListeners(Events::preDistinct)) {
            /* The distinct command currently does not have options beyond field
             * and query, so do not include it in the event args.
             */
            $this->eventManager->dispatchEvent(Events::preDistinct, new DistinctEventArgs($this, $field, $query));
        }

        $result = $this->doDistinct($field, $query, $options);

        if ($this->eventManager->hasListeners(Events::postDistinct)) {
            $eventArgs = new MutableEventArgs($this, $result);
            $this->eventManager->dispatchEvent(Events::postDistinct, $eventArgs);
            $result = $eventArgs->getData();
        }

        return $result;
    }
public function distinct($field, array $query = array(), array $options = array())
    {
        if ($this->eventManager->hasListeners(Events::preDistinct)) {
            /* The distinct command currently does not have options beyond field
             * and query, so do not include it in the event args.
             */
            $this->eventManager->dispatchEvent(Events::preDistinct, new DistinctEventArgs($this, $field, $query));
        }

        $result = $this->doDistinct($field, $query, $options);

        if ($this->eventManager->hasListeners(Events::postDistinct)) {
            $eventArgs = new MutableEventArgs($this, $result);
            $this->eventManager->dispatchEvent(Events::postDistinct, $eventArgs);
            $result = $eventArgs->getData();
        }

        return $result;
    }
public function distinct ( $ field , array $ query = array ( ) , array $ options = array ( ) ) { if ( $ this -> eventManager -> hasListeners ( Events :: preDistinct ) ) { /* The distinct command currently does not have options beyond field
             * and query, so do not include it in the event args.
             */ $ this -> eventManager -> dispatchEvent ( Events :: preDistinct , new DistinctEventArgs ( $ this , $ field , $ query ) ) ; } $ result = $ this -> doDistinct ( $ field , $ query , $ options ) ; if ( $ this -> eventManager -> hasListeners ( Events :: postDistinct ) ) { $ eventArgs = new MutableEventArgs ( $ this , $ result ) ; $ this -> eventManager -> dispatchEvent ( Events :: postDistinct , $ eventArgs ) ; $ result = $ eventArgs -> getData ( ) ; } return $ result ; }
Invokes the distinct command.

This method will dispatch preDistinct and postDistinct events.

@see http://php.net/manual/en/mongocollection.distinct.php
@see http://docs.mongodb.org/manual/reference/command/distinct/
@param string $field
@param array  $query
@param array  $options
@return ArrayIterator
@throws ResultException if the command fails
Invokes the distinct command .