# new PropertyDecorator(opts)
Parameters:
Name | Type | Description |
---|---|---|
opts |
Object | |
property |
BaseProperty | |
admin |
AdminBro | current instance of AdminBro |
options |
PropertyOptions | |
resource |
ResourceDecorator |
Members
# isVirtual
Indicates if given property has been created in AdminBro and hasn't been returned by the database adapter
# propertyPath
Property path including all parents.
For root property (this without a parent) it will be its name.
But when property has children their paths will include parent path:
parentName.subPropertyName
.
This path serves as a key in PropertyOptions to identify which property has to be updated
# private virtualSubProperties
Array of all subProperties which were added in ResourceOption interface rather than in the database
Methods
# availableValues() → {Array.<{value: string, label: string}>}
If given property has limited number of available values it returns them.
# isTitle() → {boolean}
If property should be treated as an title field Title field is used as a link to the resource page in the list view and in the breadcrumbs
# isVisible(where)
Indicates if given property should be visible
Parameters:
Name | Type | Description |
---|---|---|
where |
'list' | 'edit' | 'show' | 'filter' |
# reference() → {BaseResource}
When given property is a reference to another Resource - it returns this Resource
reference resource
# resource()
Resource decorator of given property
# subProperties() → {Array.<PropertyDecorator>}
Decorates subProperties
decorated subProperties
# toJSON(whereopt) → {PropertyJSON}
Returns JSON representation of a property
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
where |
PropertyPlace |
<optional> |
# type() → {PropertyType}
Property type