0.9.0 (latest) 0.8.0 0.7.2 0.5.0 0.4.0 0.3.0 0.2.3 0.1.2 Reference documentation and code samples for the Google Cloud Chronicle Client class Relation.

Defines the relationship between the entity (a) and another entity (b).

Generated from protobuf message `google.backstory.Relation`

## Namespace

Google \\ Backstory

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ entity` | `Noun` Entity (b) that the primary entity (a) is related to. |
| `↳ entity_type` | `int` Type of the related entity (b) in this relationship. |
| `↳ relationship` | `int` Type of relationship. |
| `↳ direction` | `int` Directionality of relationship between primary entity (a) and the related entity (b). |
| `↳ uid` | `string` UID of the relationship. |
| `↳ entity_label` | `int` Label to identify the Noun of the relation. |

### getEntity

Entity (b) that the primary entity (a) is related to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Noun|null` |   |

### hasEntity

### clearEntity

### setEntity

Entity (b) that the primary entity (a) is related to.

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

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

### getEntityType

Type of the related entity (b) in this relationship.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [EntityType](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.EntityMetadata.EntityType.md.txt). |

### setEntityType

Type of the related entity (b) in this relationship.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [EntityType](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.EntityMetadata.EntityType.md.txt). |

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

### getRelationship

Type of relationship.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Relationship](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.Relationship.md.txt). |

### setRelationship

Type of relationship.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Relationship](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.Relationship.md.txt). |

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

### getDirection

Directionality of relationship between primary entity (a) and the
related entity (b).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Directionality](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.Directionality.md.txt). |

### setDirection

Directionality of relationship between primary entity (a) and the
related entity (b).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Directionality](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.Directionality.md.txt). |

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

### getUid

UID of the relationship.

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

### setUid

UID of the relationship.

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

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

### getEntityLabel

Label to identify the Noun of the relation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [EntityLabel](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.EntityLabel.md.txt). |

### setEntityLabel

Label to identify the Noun of the relation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [EntityLabel](https://docs.cloud.google.com/php/docs/reference/cloud-chronicle/latest/Backstory.Relation.EntityLabel.md.txt). |

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