Difference between revisions of "Resource getResourceProperties"

From Catglobe Wiki
Jump to: navigation, search
Line 17: Line 17:
  
 
An ''array ''of arrays, it is an array of property objects, which contains the following items
 
An ''array ''of arrays, it is an array of property objects, which contains the following items
[i][RESOURCE_PROPERTY_TYPE] == RESOURCE_PROPERTY_TYPE_SINGLE)''
+
<table width="875" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic">
 +
<tbody><tr align="left" valign="top">
 +
<td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Index</strong></p>
 +
</td>
 +
<td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Data type</strong></p>
 +
</td>
 +
<td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Value</strong></p>
 +
</td>
 +
</tr>
 +
<tr align="left" valign="top">
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">RESOURCE_PROPERTY_TYPE</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Type of the property, it has value among the predefined constants:</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_BOOLEAN</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_DATETIME</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_MULTI</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_NUMBER</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_SINGLE</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_STRING</span></p>
 +
<p class="bodytext"><span class="normalise">- RESOURCE_PROPERTY_TYPE_RESOURCE</span></p>
 +
</td>
 +
</tr>
 +
<tr align="left" valign="top">
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">RESOURCE_PROPERTY_NAME</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Name</span></p>
 +
</td>
 +
</tr>
 +
<tr align="left" valign="top">
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">RESOURCE_PROPERTY_VALUE</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">dependent on property type</span></p>
 +
</td>
 +
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Value</span></p>
 +
</td>
 +
</tr>
  
'' //set the first option selected''
+
</tbody></table>
  
'' properties[i][RESOURCE_PROPERTY_VALUE] = 1;''
 
  
''}''
 
  
''Resource_resourcePropertiesSave(15543655, properties);''
 
  
 
'''Availability'''
 
'''Availability'''

Revision as of 04:05, 26 December 2011



Resource_getResourceProperties

Get all properties' values of a resource

Syntax

Resource_getResourceProperties(resourceId)

Arguments

  • resourceId: is a number expression, it is the resource's unique id

Return value

An array of arrays, it is an array of property objects, which contains the following items

<tbody> </tbody>

Index

Data type

Value

RESOURCE_PROPERTY_TYPE

number

Type of the property, it has value among the predefined constants:

- RESOURCE_PROPERTY_TYPE_BOOLEAN

- RESOURCE_PROPERTY_TYPE_DATETIME

- RESOURCE_PROPERTY_TYPE_MULTI

- RESOURCE_PROPERTY_TYPE_NUMBER

- RESOURCE_PROPERTY_TYPE_SINGLE

- RESOURCE_PROPERTY_TYPE_STRING

- RESOURCE_PROPERTY_TYPE_RESOURCE

RESOURCE_PROPERTY_NAME

string

Name

RESOURCE_PROPERTY_VALUE

dependent on property type

Value



Availability

Version 5.6