AtkNumberAttribute: Difference between revisions
Appearance
Rwolverine (talk | contribs) New page: {{attribute}} === Description === The atkNumberAttribute is used to represent number values. === Params === The constructor of the atkCurrencyAttribute has the following params: atkNu... |
Rwolverine (talk | contribs) |
||
| Line 5: | Line 5: | ||
=== Params === | === Params === | ||
The constructor of the | The constructor of the atkNumberAttribute has the following params: | ||
atkNumberAttribute($name, $flags=0, $size=10, $decimals=0) | atkNumberAttribute($name, $flags=0, $size=10, $decimals=0) | ||
| Line 15: | Line 15: | ||
;Size (optional) int | ;Size (optional) int | ||
;decimals (optional) int Number of decimals to show. | ;decimals (optional) int Number of decimals to show. | ||
=== Examples === | === Examples === | ||
(in a [[node]] constructor): | (in a [[node]] constructor): | ||
Revision as of 16:13, 29 February 2008

Description
The atkNumberAttribute is used to represent number values.
Params
The constructor of the atkNumberAttribute has the following params:
atkNumberAttribute($name, $flags=0, $size=10, $decimals=0)
- name String
- Name of the attribute (unique within a node, and for most attributes, corresponds to a field in the database.
- flags (optional) int
- Flags for the attribute. For more information about flags, please checkout the flags section.
- Size (optional) int
- decimals (optional) int Number of decimals to show.
Examples
(in a node constructor):
$this->add(new atkNumberAttribute("quantity", AF_OBLIGATORY, 14, 4));
Adds a field 'pieceprice' to the node that displays as US Dollars, and has a precsion of 5 decimal places. The flags hide it from the list view,
--Rwolverine 19:54, 6 December 2007 (CET)