Automattic\WooCommerce\Blocks\StoreApi\Schemas
AbstractSchema::get_item_responses_from_schema() protected WC 1.0
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 5.2.2
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 ) );
}