WireArray is the base iterable array type used throughout the ProcessWire framework.
Nearly all collections of items in ProcessWire are derived from the Wire
Below are all the public methods you can use to interact with Wireforeach()
them and get or set elements using array syntax, i.e. $value = $items[$key];
to get an item or $items[] = $item;
to add an item.
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Wire
class also inherits all the methods and properties of: Wire.
Traversal
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | Wire | Return a new copy of this Wire | |
Wire Wire Wire | array null string Wire | Perform an action upon each item in the Wire | |
Wire Wire Wire | Wire mixed bool | Returns the first item in the Wire Can also be used as property: Wire | |
Wire Wire Wire | ArrayObject Wire | Allows iteration of the Wire | |
Wire Wire Wire | Wire mixed bool | Returns the last item in the Wire Can also be used as property: Wire | |
Wire Wire Wire | array | Divide this Wire |
Retrieval
Manipulation
Info
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | bool | Does this Wire | |
Wire Wire Wire | bool | Is the given Wire | |
Wire Wire Wire | bool | Is the given item valid for storange in this array? | |
Wire Wire Wire | bool | Is the given item key valid for use in this array? | |
Wire Wire Wire | bool | Determines if the given item iterable as an array. |
Output rendering
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | array null string Wire | Perform an action upon each item in the Wire | |
Wire Wire Wire | string | Combine all elements into a delimiter-separated string containing the given property from each item |
Other data storage
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | Wire mixed array null | Store or retrieve an extra data value in this Wire | |
Wire Wire Wire | $this | Remove a property/value previously set with the Wire |
Changes
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | array Wire | Return array of all items added to this Wire | |
Wire Wire Wire | array Wire | Return array of all items removed from this Wire |
Fun tools
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | Wire | Return a new copy of this Wire | |
Wire Wire Wire | null mixed | Handler for when an unknown/unhooked method call is executed | |
Wire Wire Wire | array null string Wire | Perform an action upon each item in the Wire | |
Wire Wire Wire | array | Return a plain array of the requested property from each item | |
Wire Wire Wire | string | Combine all elements into a delimiter-separated string containing the given property from each item |
For hooks
These methods are only useful for hooking and should not be called directly.
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | null mixed | Handler for when an unknown/unhooked method call is executed |
Common
Name | Return | Summary | |
---|---|---|---|
Wire Wire Wire | static | ) | |
Wire | array | All keys used in this Wire | |
Wire Wire Wire | (nothing) | Set the current duplicate checking state | |
Wire | array | All values used in this Wire |
Additional methods and properties
In addition to the methods and properties above, Wire
API reference based on ProcessWire core version 3.0.244