WireArray::replace()
Replace one item with the other
- The order of the arguments does not matter.
- If both items are already present, they will change places.
- If one item is not already present, it will replace the one that is.
- If neither item is present, both will be added at the end.
Example
$items->replace($existingItem, $newItem);
Usage
$wireArray->replace($itemA, $itemB);
WireArray methods and properties
API reference based on ProcessWire core version 3.0.251