Google\Cloud\Datastore\Query\Query::distinctOn PHP Méthode

distinctOn() public méthode

The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned). Example: $query->distinctOn('lastName');
public distinctOn ( array | string $property ) : Query
$property array | string The property or properties to make distinct.
Résultat Query
    public function distinctOn($property)
    {
        if (!is_array($property)) {
            $property = [$property];
        }
        foreach ($property as $prop) {
            $this->query['distinctOn'][] = $this->propertyName($prop);
        }
        return $this;
    }