# Stackdriver Trace V2 Client - Class TimeEvent (2.0.0)

2.0.0 (latest) 2.0.0-RC1 1.9.5 1.8.10 1.7.0 1.6.5 1.5.3 1.4.11 Reference documentation and code samples for the Stackdriver Trace V2 Client class TimeEvent.

A time-stamped annotation or message event in the Span.

Generated from protobuf message `google.devtools.cloudtrace.v2.Span.TimeEvent`

## Namespace

Google \\ Cloud \\ Trace \\ V2 \\ Span

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The timestamp indicating the time the event occurred. |
| `↳ annotation` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.Annotation` Text annotation with a set of attributes. |
| `↳ message_event` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.MessageEvent` An event describing a message sent/received between Spans. |

### getTime

The timestamp indicating the time the event occurred.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasTime

### clearTime

### setTime

The timestamp indicating the time the event occurred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getAnnotation

Text annotation with a set of attributes.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.Annotation|null` |   |

### hasAnnotation

### setAnnotation

Text annotation with a set of attributes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.Annotation` |

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

### getMessageEvent

An event describing a message sent/received between Spans.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.MessageEvent|null` |   |

### hasMessageEvent

### setMessageEvent

An event describing a message sent/received between Spans.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.Span.TimeEvent.MessageEvent` |

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

### getValue

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