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

namespace Google\Cloud\Spanner\V1;

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

/**
 * Contains an ordered list of nodes appearing in the query plan.
 *
 * Generated from protobuf message <code>google.spanner.v1.QueryPlan</code>
 */
class QueryPlan extends \Google\Protobuf\Internal\Message
{
    /**
     * The nodes in the query plan. Plan nodes are returned in pre-order starting
     * with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
     * `plan_nodes`.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.PlanNode plan_nodes = 1;</code>
     */
    private $plan_nodes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Spanner\V1\PlanNode[]|\Google\Protobuf\Internal\RepeatedField $plan_nodes
     *           The nodes in the query plan. Plan nodes are returned in pre-order starting
     *           with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
     *           `plan_nodes`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Spanner\V1\QueryPlan::initOnce();
        parent::__construct($data);
    }

    /**
     * The nodes in the query plan. Plan nodes are returned in pre-order starting
     * with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
     * `plan_nodes`.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.PlanNode plan_nodes = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPlanNodes()
    {
        return $this->plan_nodes;
    }

    /**
     * The nodes in the query plan. Plan nodes are returned in pre-order starting
     * with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
     * `plan_nodes`.
     *
     * Generated from protobuf field <code>repeated .google.spanner.v1.PlanNode plan_nodes = 1;</code>
     * @param \Google\Cloud\Spanner\V1\PlanNode[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPlanNodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\V1\PlanNode::class);
        $this->plan_nodes = $arr;

        return $this;
    }

}

