Lists final class
Minn\Support\Lists · public/minn/src/Minn/Support/Lists.php · 190 lines
List shaping behind the facade's array utilities: arguments over their defaults (wp_parse_args), plucking and filtering (WP_List_Util), the multi-field sort wp_list_sort() promises (loose comparison per field, first difference wins) and the row-shape conversions wpdb hands back for its OBJECT_K / ARRAY_A / ARRAY_N output formats.
Used by 25 (show)
Public
| static | args(mixed $args, mixed $defaults = array ( )): array# | Arguments as WordPress takes them (wp_parse_args): an object's properties, an array, or a query string, over the defaults.
@return array<array-key, mixed> | ||||||||||||
| static | pluck(array $items, string|int $field, string|int|null $indexKey = NULL): array# | One field of each item (wp_list_pluck), keyed as the list was, or by another field when one is named (items without it are appended); anything not an array or an object is passed over.
@return array<array-key, mixed> | ||||||||||||
| static | filter(array $items, array $fields, string $operator): array# | The items matching all the fields given (AND), any of them (OR), or none (NOT), compared loosely, keys kept; nothing for another operator.
@return array<array-key, mixed> | ||||||||||||
| static | items(mixed $input): array# | A list as arguments give one (wp_parse_list): an array's entries trimmed, the empty ones dropped (keys kept); a string split on commas and whitespace. @return array<int|string, string> | ||||||||||||
| static | ids(mixed $input): array# | Ids as arguments give them (wp_parse_id_list): each a whole number made positive, each once, in first-seen order. @return list<int> | ||||||||||||
| static | sort(array $items, array $orderby, bool $preserveKeys): array# | Items sorted by several fields, each ascending or descending.
@return array<int|string, mixed> | ||||||||||||
| static | shapeRows(array $rows, string $output): array# | Rows of stdClass shaped for a wpdb output format: keyed by their first column (first row wins a duplicate key), associative, or numeric.
@return array<int|string, mixed> | ||||||||||||
| static | descendants(array $items, int $rootId, callable $id, callable $parent, array $visited = array ( )): array# | Every descendant of one root in a flat parent-linked list, preorder (a child ahead of its own children), the shape _get_term_children and get_page_children walk. Visited ids guard against a parent cycle.
@return list<mixed> |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | keyedByFirstColumn(array $rows): array# |
@return array<string, object> |
Nothing matches.