update_item¶
Summary¶
- update_item(Item|int $item, array $metadata = Array, array $elementTexts = Array, array $fileMetadata = Array)¶
Update an existing item.
Parameters: - $item (Item|int) – Either an Item object or the ID for the item.
- $metadata (array) – Set of options that can be passed to the item.
- $elementTexts (array) –
- $fileMetadata (array) –
Returns: Item
Usage¶
Valid keys for the $metadata array include:
- 'item_type_id' : integer
- The ID of the Item Type for the Item.
- 'item_type_name' : string
- The name of the Item Type for the Item. This option takes precedence over 'item_type_id' if both are specified.
- 'collection_id' : integer
- The ID of the Collection the item belongs to.
- 'public' : integer
- Whether the Item is public (set 1 or 0).
- 'featured' : integer
- Whether the Item is featured (set 1 or 0).
- 'overwriteElementTexts' : mixed
- If present with any value, the element texts passed in $elementTexts replace the existing texts instead of appending to them.
The $elementTexts array has the same format as the array passed to Mixin_ElementText::addElementTextsByArray.