# Stackdriver Error Reporting V1beta1 Client - Class ErrorEvent (0.26.1)

0.26.1 (latest) 0.26.0 0.25.3 0.24.0 0.23.1 0.22.10 0.21.1 0.20.2 0.19.12

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Stackdriver Error Reporting V1beta1 Client class ErrorEvent.

An error event which is returned by the Error Reporting system.

Generated from protobuf message `google.devtools.clouderrorreporting.v1beta1.ErrorEvent`

## Namespace

Google \\ Cloud \\ ErrorReporting \\ V1beta1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ event_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Time when the event occurred as provided in the error report. If the report did not contain a timestamp, the time the error was received by the Error Reporting system is used. |
| `↳ service_context` | `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ServiceContext` The `ServiceContext` for which this error was reported. |
| `↳ message` | `string` The stack trace that was reported or logged by the service. |
| `↳ context` | `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ErrorContext` Data about the context in which the error occurred. |

### getEventTime

Time when the event occurred as provided in the error report.

If the report did not contain a timestamp, the time the error was received
by the Error Reporting system is used.

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

### hasEventTime

### clearEventTime

### setEventTime

Time when the event occurred as provided in the error report.

If the report did not contain a timestamp, the time the error was received
by the Error Reporting system is used.

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

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

### getServiceContext

The `ServiceContext` for which this error was reported.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ServiceContext|null` |   |

### hasServiceContext

### clearServiceContext

### setServiceContext

The `ServiceContext` for which this error was reported.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ServiceContext` |

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

### getMessage

The stack trace that was reported or logged by the service.

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

### setMessage

The stack trace that was reported or logged by the service.

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

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

### getContext

Data about the context in which the error occurred.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ErrorContext|null` |   |

### hasContext

### clearContext

### setContext

Data about the context in which the error occurred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-error-reporting/latest/V1beta1.ErrorContext` |

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