Category
Extends
AbstractEntity
class Category extends AbstractEntity
Static
create
static create(json = null): Category
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | null | object | No | null | Used to constructor from a JSON representation. See fromJSON |
Returns:
Type: Category
getName
static getName(): "Category"
Returns:
Type: constant ("Category": string)
Constructor
constructor
constructor(json = null): Category
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | null | object | No | null | Used to constructor from a JSON representation. See fromJSON |
Properties
children
Type | Default | Description |
---|---|---|
OrderedCollection<Category> | new OrderedCollection('Category') |
client_id
Type | Default | Description |
---|---|---|
string | null | null |
color
Should be in web color format, matching the regex /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
Type | Default | Description |
---|---|---|
string | null | null |
created_at
Type | Default | Description |
---|---|---|
Date | null | null |
Read-Only
id
Type | Default | Description |
---|---|---|
null | int | symbol | null | The entity identifier |
logo
Type | Default | Description |
---|---|---|
Reference<File> | new Reference('File', null) |
metadata
Type | Default | Description |
---|---|---|
Map | new Map() |
name
Type | Default | Description |
---|---|---|
string | null |
parameters
Type | Default | Description |
---|---|---|
Set<string> | new Set() |
parents
Type | Default | Description |
---|---|---|
Collection<Category> | new Collection('Category') |
pois
Type | Default | Description |
---|---|---|
Collection<Poi> | new Collection('Poi') |
rank
Type | Default | Description |
---|---|---|
int | 0 |
signature
Type | Default | Description |
---|---|---|
string | null | null |
site
Type | Default | Description |
---|---|---|
Reference<Site> | new Reference('Site', null) |
tags
Type | Default | Description |
---|---|---|
Collection<Tag> | new Collection('Tag') |
type
Type | Default | Description |
---|---|---|
string | null | null |
updated_at
Type | Default | Description |
---|---|---|
Date | null | null |
Read-Only
version
Type | Default | Description |
---|---|---|
int | null |
Read-Only
Methods
toJSON
toJSON(): object
Returns:
Type: object (see properties bellow)
Name | Type | Description |
---|---|---|
children | Array<{id: int | symbol, position: int}> | |
client_id | string | null | |
color | string | null | |
created_at | string | null | Datetime in ISO 8601 format |
id | null | int | symbol | |
logo | null | int | symbol | |
metadata | object | |
name | string | null | |
parameters | string[] | |
parents | Array<int | symbol> | |
pois | Array<int | symbol> | |
rank | int | |
signature | string | null | |
site | int | symbol | null | |
tags | Array<int | symbol> | |
type | string | null | |
updated_at | string | null | Datetime in ISO 8601 format |
version | int | null |
fromJSON
fromJSON(json: object): Category
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
json | object | Yes | - | |
json.children | Array<{id: int | symbol, position: int}> | No | [] | |
json.client_id | string | null | No | null | |
json.color | string | null | No | null | |
json.created_at | string | null | No | null | Datetime in ISO 8601 format |
json.id | null | int | symbol | No | null | |
json.logo | null | int | symbol | No | null | |
json.metadata | object | No | {} | |
json.name | string | null | No | null | |
json.parameters | string[] | No | [] | |
json.parents | Array<int | symbol> | No | [] | |
json.pois | Array<int | symbol> | No | [] | |
json.rank | int | No | 0 | |
json.signature | string | null | No | null | |
json.site | int | symbol | null | No | null | |
json.tags | Array<int | symbol> | No | [] | |
json.type | string | null | No | null | |
json.updated_at | string | null | No | null | Datetime in ISO 8601 format |
json.version | int | null | No | null |
Returns:
Returns this
clone
clone(): Category
Returns:
A new deep copy
Type: Category