<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/firestore/v1/query.proto

namespace Google\Cloud\Firestore\V1\StructuredQuery;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The projection of document's fields to return.
 *
 * Generated from protobuf message <code>google.firestore.v1.StructuredQuery.Projection</code>
 */
class Projection extends \Google\Protobuf\Internal\Message
{
    /**
     * The fields to return.
     * If empty, all fields are returned. To only return the name
     * of the document, use `['__name__']`.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2;</code>
     */
    private $fields;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $fields
     *           The fields to return.
     *           If empty, all fields are returned. To only return the name
     *           of the document, use `['__name__']`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\V1\Query::initOnce();
        parent::__construct($data);
    }

    /**
     * The fields to return.
     * If empty, all fields are returned. To only return the name
     * of the document, use `['__name__']`.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFields()
    {
        return $this->fields;
    }

    /**
     * The fields to return.
     * If empty, all fields are returned. To only return the name
     * of the document, use `['__name__']`.
     *
     * Generated from protobuf field <code>repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2;</code>
     * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFields($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class);
        $this->fields = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Projection::class, \Google\Cloud\Firestore\V1\StructuredQuery_Projection::class);

