Automattic\WooCommerce\StoreApi\Schemas\V1
AbstractSchema::get_item_responses_from_schema()
Apply a schema get_item_response callback to an array of items and return the result.
Метод класса: AbstractSchema{}
Хуков нет.
Возвращает
Массив
. Array of values from the callback function.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_item_responses_from_schema( $schema, $items );
- $schema(AbstractSchema) (обязательный)
- Schema class instance.
- $items(массив) (обязательный)
- Array of items.
Код AbstractSchema::get_item_responses_from_schema() AbstractSchema::get item responses from schema WC 7.5.1
protected function get_item_responses_from_schema( AbstractSchema $schema, $items ) { $items = array_filter( $items ); if ( empty( $items ) ) { return []; } return array_values( array_map( [ $schema, 'get_item_response' ], $items ) ); }