---
title: "ZeyOS.Object"
description: "Base"
canonical_url: "https://www.zeyos.com/zymba/ref/zeyos/zeyos-object"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/zeyos/zeyos-object.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# ZeyOS.Object

## ZeyOS.Object

```
object @ZeyOS.Object(@Base) {
	construct(string $entity, ?int $id) {}
	addTags(object $names): $this {}
	canDelete(): bool {}
	clear(): $this {}
	delete(): bool {}
	erase(?function $callback): bool {}
	eraseRaw(): bool {}
	exists(): bool {}
	getEntity(): string {}
	getField(string $name): ?string {}
	getFieldArray(string $name): ?object {}
	getFieldJSON(string $name): ?object {}
	getID(): int {}
	hasAccess(bool $writable): bool {}
	hasField(string $name): bool {}
	listExtData(): object {}
	listFieldNames(): object {}
	listFields(): object {}
	listTags(): object {}
	readBinFile(string $name): string {}
	reload(): $this {}
	removeFields(object $names): $this {}
	removeTags(object $names): $this {}
	resetTags(object $names): $this {}
	save(?function $callback, object $extdata, object $tags): $this {}
	saveRaw(): $this {}
	selectExtData(): object {}
	selectTags(): object {}
	setExtData(object $fields): $this {}
	setField(string $name, ?string $value): $this {}
	setFieldArray(string $name, ?object $array): $this {}
	setFieldEncrypted(string $name, ?string $value): $this {}
	setFieldJSON(string $name, ?object $array): $this {}
	setFields(object $fields): $this {}
	writeBinFile(string $name, string $data): $this {}
}
```

### Prototype

**[Base](#)**

## Methods


### `$this.construct()`


```code
$this.construct(string $entity, ?int $id): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| entity | `string`  |  | "" |
| id | `?int`  |  | new |




### `$this.addTags()`


```code
$this.addTags(object $names): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| names | `object`  | [name, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.canDelete()`


```code
$this.canDelete(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.clear()`


```code
$this.clear(): this
```

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.delete()`


```code
$this.delete(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.erase()`


```code
$this.erase(?function $callback): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| callback | `?function`  |  | no callback |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.eraseRaw()`


```code
$this.eraseRaw(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.exists()`


```code
$this.exists(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.getEntity()`


```code
$this.getEntity(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.getField()`


```code
$this.getField(string $name): ?string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `?string` |  |




### `$this.getFieldArray()`


```code
$this.getFieldArray(string $name): ?object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `?object` |  |




### `$this.getFieldJSON()`


```code
$this.getFieldJSON(string $name): ?object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `?object` |  |




### `$this.getID()`


```code
$this.getID(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |
| `null` |  |




### `$this.hasAccess()`


```code
$this.hasAccess(bool $writable): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| writable | `bool`  |  | false |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.hasField()`


```code
$this.hasField(string $name): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.listExtData()`


```code
$this.listExtData(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [name: value, ...] |




### `$this.listFieldNames()`


```code
$this.listFieldNames(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [name, ...] |




### `$this.listFields()`


```code
$this.listFields(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [name: value, ...] |




### `$this.listTags()`


```code
$this.listTags(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [name, ...] |




### `$this.readBinFile()`


```code
$this.readBinFile(string $name): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.reload()`


```code
$this.reload(): this
```

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.removeFields()`


```code
$this.removeFields(object $names): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| names | `object`  | [name, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.removeTags()`


```code
$this.removeTags(object $names): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| names | `object`  | [name, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.resetTags()`


```code
$this.resetTags(object $names): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| names | `object`  | [name, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.save()`


```code
$this.save(?function $callback, object $extdata, object $tags): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| callback | `?function`  |  | no callback |
| extdata | `object`  | [name: value, ...] | [] |
| tags | `object`  | [name, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.saveRaw()`


```code
$this.saveRaw(): this
```

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.selectExtData()`


```code
$this.selectExtData(): @ZeyOS.ExtData
```

##### Returns

| Type | Value |
| --- | ---  |
| `@ZeyOS.ExtData` |  |
| `null` |  |




### `$this.selectTags()`


```code
$this.selectTags(): @ZeyOS.Tags
```

##### Returns

| Type | Value |
| --- | ---  |
| `@ZeyOS.Tags` |  |
| `null` |  |




### `$this.setExtData()`


```code
$this.setExtData(object $fields): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| fields | `object`  | [name: value, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setField()`


```code
$this.setField(string $name, ?string $value): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| value | `?string`  |  | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setFieldArray()`


```code
$this.setFieldArray(string $name, ?object $array): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| array | `?object`  | [value, ...] | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setFieldEncrypted()`


```code
$this.setFieldEncrypted(string $name, ?string $value): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| value | `?string`  |  | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setFieldJSON()`


```code
$this.setFieldJSON(string $name, ?object $array): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| array | `?object`  |  | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setFields()`


```code
$this.setFields(object $fields): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| fields | `object`  | [name: value, ...] | [] |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.writeBinFile()`


```code
$this.writeBinFile(string $name, string $data): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| data | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |
