JamesMoss\Flywheel\Result::hash PHP Метод

hash() публичный Метод

Returns an assoiative array (a hash), where for each document the value of one property is the key, and another property is the value.
public hash ( string $keyField, string $valueField ) : array
$keyField string The name of the property to use for the key.
$valueField string Name of the property to use for the value.
Результат array An associative array.
    public function hash($keyField, $valueField)
    {
        $result = array();
        foreach ($this->documents as $document) {
            $result[$document->{$keyField}] = $document->{$valueField};
        }
        return $result;
    }