# Google Maps Route Optimization V1 Client - Class DurationDistanceMatrix (0.6.2)

0.6.2 (latest) 0.6.1 0.5.1 0.4.1 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Maps Route Optimization V1 Client class DurationDistanceMatrix.

Specifies a duration and distance matrix from visit and vehicle start
locations to visit and vehicle end locations.

Generated from protobuf message `google.maps.routeoptimization.v1.ShipmentModel.DurationDistanceMatrix`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1 \\ ShipmentModel

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ rows` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel.DurationDistanceMatrix.Row>` Specifies the rows of the duration and distance matrix. It must have as many elements as [ShipmentModel.duration_distance_matrix_src_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getDurationDistanceMatrixSrcTags__). |
| `↳ vehicle_start_tag` | `string` Tag defining to which vehicles this duration and distance matrix applies. If empty, this applies to all vehicles, and there can only be a single matrix. Each vehicle start must match exactly one matrix, i.e. exactly one of their `start_tags` field must match the `vehicle_start_tag` of a matrix (and of that matrix only). All matrices must have a different `vehicle_start_tag`. |

### getRows

Specifies the rows of the duration and distance matrix. It must have as
many elements as
[ShipmentModel.duration_distance_matrix_src_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getDurationDistanceMatrixSrcTags__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel.DurationDistanceMatrix.Row>` |   |

### setRows

Specifies the rows of the duration and distance matrix. It must have as
many elements as
[ShipmentModel.duration_distance_matrix_src_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getDurationDistanceMatrixSrcTags__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel.DurationDistanceMatrix.Row>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVehicleStartTag

Tag defining to which vehicles this duration and distance matrix applies.

If empty, this applies to all vehicles, and there can only be a single
matrix.
Each vehicle start must match exactly one matrix, i.e. exactly one of
their `start_tags` field must match the `vehicle_start_tag` of a matrix
(and of that matrix only).
All matrices must have a different `vehicle_start_tag`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setVehicleStartTag

Tag defining to which vehicles this duration and distance matrix applies.

If empty, this applies to all vehicles, and there can only be a single
matrix.
Each vehicle start must match exactly one matrix, i.e. exactly one of
their `start_tags` field must match the `vehicle_start_tag` of a matrix
(and of that matrix only).
All matrices must have a different `vehicle_start_tag`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |