Entity::data: Difference between revisions
No edit summary |
No edit summary |
||
| (9 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
This property is used to get or set entity data. | This property is used to get or set entity data. | ||
== | If you use [[Entity::setVariable|setVariable]] you have to use [[Entity::getVariable|getVariable]] to get results. e.g. You can't do <code>entity.setVariable('foo','bar')</code> and get the result with <code>entity.data.foo</code> as getter. You can do so clientside, but not serverside. | ||
* ''' | |||
== Property Type(s) & Attribute(s) == | |||
* Getter - attribute should be in '''any''' format. | |||
* Setter - attribute should be in '''any''' format. | |||
== Example == | == Example == | ||
The code below is an example about how to set a entity data by directly manipulating its "data" attribute. | |||
< | {{ServersideCode| | ||
<pre> | |||
</ | entity.data.foo = bar; | ||
</pre> | |||
}} | |||
[[Category:Entity API]] | |||
[[Category:Server-side Property]] | |||
Latest revision as of 10:28, 30 April 2019
This property is used to get or set entity data.
If you use setVariable you have to use getVariable to get results. e.g. You can't do entity.setVariable('foo','bar') and get the result with entity.data.foo as getter. You can do so clientside, but not serverside.
Property Type(s) & Attribute(s)
- Getter - attribute should be in any format.
- Setter - attribute should be in any format.
Example
The code below is an example about how to set a entity data by directly manipulating its "data" attribute.
Server-Side
entity.data.foo = bar;