PHP 클래스 WP_CLI\Formatter

파일 보기 프로젝트 열기: wp-cli/wp-cli 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array &$assoc_args, array $fields = null, string $prefix = false )
__get ( string $key ) : mixed Magic getter for arguments.
display_item ( mixed $item ) Display a single item according to the output arguments.
display_items ( array $items ) Display multiple items according to the output arguments.
transform_item_values_to_json ( mixed $item ) : mixed Transforms objects and arrays to JSON as necessary

비공개 메소드들

메소드 설명
assoc_array_to_rows ( array $fields ) : array Format an associative array as a table.
find_item_key ( object $item, string $field ) : string Find an object's key.
format ( array $items ) Format items according to arguments.
show_multiple_fields ( $data, $format ) Show multiple fields of an object.
show_single_field ( $items, $field ) Show a single field from a list of items.
show_table ( array $items, array $fields ) Show items in a \cli\Table.

메소드 상세

__construct() 공개 메소드

public __construct ( array &$assoc_args, array $fields = null, string $prefix = false )
$assoc_args array Output format arguments.
$fields array Fields to display of each item.
$prefix string Check if fields have a standard prefix.

__get() 공개 메소드

Magic getter for arguments.
public __get ( string $key ) : mixed
$key string
리턴 mixed

display_item() 공개 메소드

Display a single item according to the output arguments.
public display_item ( mixed $item )
$item mixed

display_items() 공개 메소드

Display multiple items according to the output arguments.
public display_items ( array $items )
$items array

transform_item_values_to_json() 공개 메소드

Transforms objects and arrays to JSON as necessary
public transform_item_values_to_json ( mixed $item ) : mixed
$item mixed
리턴 mixed