Function __global->get_catalogue_entry_field_values
Definitions
sources/catalogues.php
- Get the values for the specified fields, for the stated catalogue entry.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $catalogue_name | ?ID_TEXT | No | No | required parameter | N/A | N/A | The catalogue name we are getting an entry in (null: lookup, only works if $entry_id is a real ID) |
| $entry_id | mixed | No | No | required parameter | N/A | N/A | The ID of the entry we are getting OR the row |
| $only_fields | ?array | No | No | Null | N/A | N/A | A list of fields that we are limiting ourselves to (null: get ALL fields) |
| $fields | ?array | No | No | Null | N/A | N/A | The database rows for the fields for this catalogue (null: find them) |
| $natural_order | boolean | No | No | False | N/A | N/A | Whether to order the fields in their natural database order. This is only used for shopping catalogues as a defence against webmaster field reordering and not a strong guarantee |
| $view_type | ID_TEXT | No | No | PAGE | PAGE SEARCH CATEGORY | N/A | The view type we're doing |
| $lang | ?LANGUAGE_NAME | No | No | Null | N/A | N/A | Language codename (null: current user's language) |
Returns
- A list of maps (each field for the entry gets a map), where each map contains 'effective_value' (the value for the field). Some maps get additional fields (effective_value_pure), depending on the field type
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get the values for the specified fields, for the stated catalogue entry.
*
* @param ?ID_TEXT $catalogue_name The catalogue name we are getting an entry in (null: lookup, only works if $entry_id is a real ID)
* @param mixed $entry_id The ID of the entry we are getting OR the row
* @param ?array $only_fields A list of fields that we are limiting ourselves to (null: get ALL fields)
* @param ?array $fields The database rows for the fields for this catalogue (null: find them)
* @param boolean $natural_order Whether to order the fields in their natural database order. This is only used for shopping catalogues as a defence against webmaster field reordering and not a strong guarantee
* @param ID_TEXT $view_type The view type we're doing
* @set PAGE SEARCH CATEGORY
* @param ?LANGUAGE_NAME $lang Language codename (null: current user's language)
* @return array A list of maps (each field for the entry gets a map), where each map contains 'effective_value' (the value for the field). Some maps get additional fields (effective_value_pure), depending on the field type
*/
function get_catalogue_entry_field_values(?string $catalogue_name, $entry_id, ?array $only_fields = null, ?array $fields = null, bool $natural_order = false, string $view_type = 'PAGE', ?string $lang = null) : array
* Get the values for the specified fields, for the stated catalogue entry.
*
* @param ?ID_TEXT $catalogue_name The catalogue name we are getting an entry in (null: lookup, only works if $entry_id is a real ID)
* @param mixed $entry_id The ID of the entry we are getting OR the row
* @param ?array $only_fields A list of fields that we are limiting ourselves to (null: get ALL fields)
* @param ?array $fields The database rows for the fields for this catalogue (null: find them)
* @param boolean $natural_order Whether to order the fields in their natural database order. This is only used for shopping catalogues as a defence against webmaster field reordering and not a strong guarantee
* @param ID_TEXT $view_type The view type we're doing
* @set PAGE SEARCH CATEGORY
* @param ?LANGUAGE_NAME $lang Language codename (null: current user's language)
* @return array A list of maps (each field for the entry gets a map), where each map contains 'effective_value' (the value for the field). Some maps get additional fields (effective_value_pure), depending on the field type
*/
function get_catalogue_entry_field_values(?string $catalogue_name, $entry_id, ?array $only_fields = null, ?array $fields = null, bool $natural_order = false, string $view_type = 'PAGE', ?string $lang = null) : array

