# Google Cloud Dms V1 Client - Class DatabaseEntity (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.5.5 1.4.2 1.3.0 1.2.1 1.1.0 1.0.5 Reference documentation and code samples for the Google Cloud Dms V1 Client class DatabaseEntity.

The base entity type for all the database related entities.

The message contains the entity name, the name of its parent, the entity
type, and the specific details per entity type.

Generated from protobuf message `google.cloud.clouddms.v1.DatabaseEntity`

## Namespace

Google \\ Cloud \\ CloudDms \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ short_name` | `string` The short name (e.g. table name) of the entity. |
| `↳ parent_entity` | `string` The full name of the parent entity (e.g. schema name). |
| `↳ tree` | `int` The type of tree the entity belongs to. |
| `↳ entity_type` | `int` The type of the database entity (table, view, index, ...). |
| `↳ mappings` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityMapping>` Details about entity mappings. For source tree entities, this holds the draft entities which were generated by the mapping rules. For draft tree entities, this holds the source entities which were converted to form the draft entity. Destination entities will have no mapping details. |
| `↳ entity_ddl` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityDdl>` Details about the entity DDL script. Multiple DDL scripts are provided for child entities such as a table entity will have one DDL for the table with additional DDLs for each index, constraint and such. |
| `↳ issues` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityIssue>` Details about the various issues found for the entity. |
| `↳ database` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseInstanceEntity` Database. |
| `↳ schema` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SchemaEntity` Schema. |
| `↳ table` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.TableEntity` Table. |
| `↳ view` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ViewEntity` View. |
| `↳ sequence` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SequenceEntity` Sequence. |
| `↳ stored_procedure` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StoredProcedureEntity` Stored procedure. |
| `↳ database_function` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.FunctionEntity` Function. |
| `↳ synonym` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SynonymEntity` Synonym. |
| `↳ database_package` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.PackageEntity` Package. |
| `↳ udt` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.UDTEntity` UDT. |
| `↳ materialized_view` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MaterializedViewEntity` Materialized view. |

### getShortName

The short name (e.g. table name) of the entity.

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

### setShortName

The short name (e.g. table name) of the entity.

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

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

### getParentEntity

The full name of the parent entity (e.g. schema name).

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

### setParentEntity

The full name of the parent entity (e.g. schema name).

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

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

### getTree

The type of tree the entity belongs to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TreeType](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseEntity.TreeType). |

### setTree

The type of tree the entity belongs to.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TreeType](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseEntity.TreeType). |

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

### getEntityType

The type of the database entity (table, view, index, ...).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DatabaseEntityType](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseEntityType). |

### setEntityType

The type of the database entity (table, view, index, ...).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [DatabaseEntityType](https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseEntityType). |

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

### getMappings

Details about entity mappings.

For source tree entities, this holds the draft entities which were
generated by the mapping rules.
For draft tree entities, this holds the source entities which were
converted to form the draft entity.
Destination entities will have no mapping details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityMapping>` |   |

### setMappings

Details about entity mappings.

For source tree entities, this holds the draft entities which were
generated by the mapping rules.
For draft tree entities, this holds the source entities which were
converted to form the draft entity.
Destination entities will have no mapping details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityMapping>` |

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

### getEntityDdl

Details about the entity DDL script. Multiple DDL scripts are provided for
child entities such as a table entity will have one DDL for the table with
additional DDLs for each index, constraint and such.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityDdl>` |   |

### setEntityDdl

Details about the entity DDL script. Multiple DDL scripts are provided for
child entities such as a table entity will have one DDL for the table with
additional DDLs for each index, constraint and such.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityDdl>` |

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

### getIssues

Details about the various issues found for the entity.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityIssue>` |   |

### setIssues

Details about the various issues found for the entity.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.EntityIssue>` |

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

### getDatabase

Database.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseInstanceEntity|null` |   |

### hasDatabase

### setDatabase

Database.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.DatabaseInstanceEntity` |

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

### getSchema

Schema.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SchemaEntity|null` |   |

### hasSchema

### setSchema

Schema.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SchemaEntity` |

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

### getTable

Table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.TableEntity|null` |   |

### hasTable

### setTable

Table.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.TableEntity` |

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

### getView

View.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ViewEntity|null` |   |

### hasView

### setView

View.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.ViewEntity` |

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

### getSequence

Sequence.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SequenceEntity|null` |   |

### hasSequence

### setSequence

Sequence.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SequenceEntity` |

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

### getStoredProcedure

Stored procedure.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StoredProcedureEntity|null` |   |

### hasStoredProcedure

### setStoredProcedure

Stored procedure.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.StoredProcedureEntity` |

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

### getDatabaseFunction

Function.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.FunctionEntity|null` |   |

### hasDatabaseFunction

### setDatabaseFunction

Function.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.FunctionEntity` |

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

### getSynonym

Synonym.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SynonymEntity|null` |   |

### hasSynonym

### setSynonym

Synonym.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.SynonymEntity` |

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

### getDatabasePackage

Package.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.PackageEntity|null` |   |

### hasDatabasePackage

### setDatabasePackage

Package.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.PackageEntity` |

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

### getUdt

UDT.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.UDTEntity|null` |   |

### hasUdt

### setUdt

UDT.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.UDTEntity` |

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

### getMaterializedView

Materialized view.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MaterializedViewEntity|null` |   |

### hasMaterializedView

### setMaterializedView

Materialized view.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MaterializedViewEntity` |

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

### getEntityBody

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