WP_AI_Client_Cache::iterable_to_array
Converts an iterable to an array.
Method of the class: WP_AI_Client_Cache{}
No Hooks.
Returns
Array
Usage
// private - for code of main (parent) class only $result = $this->iterable_to_array( $items ): array;
- $items(iterable
) (required) - The iterable to convert.
Changelog
| Since 7.0.0 | Introduced. |
WP_AI_Client_Cache::iterable_to_array() WP AI Client Cache::iterable to array code WP 7.0
private function iterable_to_array( $items ): array {
if ( is_array( $items ) ) {
return $items;
}
return iterator_to_array( $items );
}