PHP 클래스 PodsField_Pick, pods

상속: extends PodsField
파일 보기 프로젝트 열기: pods-framework/pods 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$custom_related_objects array Custom Related Objects
$field_data array Data used during input method (mainly for autocomplete)
$group string Field Type Group
$label string Field Type Label
$related_data array Data used during validate / save to avoid extra queries
$related_objects array Available Related Objects
$type string Field Type Identifier

보호된 프로퍼티들

프로퍼티 타입 설명
$api PodsAPI API caching for fields that need it during validate/save

공개 메소드들

메소드 설명
__construct ( ) Setup related objects list
admin_ajax_relationship ( ) Handle autocomplete AJAX
admin_init ( ) Add admin_init actions
bidirectional_objects ( ) : array Return available bidirectional object names
data ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null, boolean $in_form = true ) : array Get the data from the field
data_capabilities ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for User Capabilities
data_countries ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for Countries
data_days_of_week ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for US States
data_image_sizes ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for Image Sizes
data_months_of_year ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for US States
data_post_stati ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for Post Stati
data_roles ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for User Roles
data_us_states ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array Data callback for US States
delete ( integer $id = null, string $name = null, array $options = null, array $pod = null ) Delete the value from the DB
display ( mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null ) Change the way the value of the field is displayed with Pods::get
get_field_data ( array | string $field, array $options = [], array $object_params = [] ) : array Get available items from a relationship field
get_object_data ( array $object_params = null ) : array | boolean Get data from relationship objects
input ( string $name, mixed $value = null, array $options = null, array $pod = null, integer $id = null ) Customize output of the form field
options ( ) : array Add options and set defaults to
register_related_object ( string $name, string $label, array $options = null ) : array | boolean Register a related object
related_objects ( boolean $force = false ) : array Return available related objects
save ( mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null ) Save the value to the DB
schema ( array $options = null ) : array Define the current field's schema for DB table storage
setup_related_objects ( boolean $force = false ) : boolean Setup related objects
simple_objects ( ) : array Return available simple object names
simple_value ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null, boolean $raw = false ) : mixed Convert a simple value to the correct value
ui ( integer $id, mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null ) Customize the Pods UI manage table column output
validate ( mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null, integer $id = null, null $params = null ) : array | boolean Validate a value before it's saved
value_to_label ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : string Get the label from a pick value

메소드 상세

__construct() 공개 메소드

Setup related objects list
부터: 2.0
public __construct ( )

admin_ajax_relationship() 공개 메소드

Handle autocomplete AJAX
부터: 2.3

admin_init() 공개 메소드

Add admin_init actions
부터: 2.3
public admin_init ( )

bidirectional_objects() 공개 메소드

Return available bidirectional object names
부터: 2.3.4
public bidirectional_objects ( ) : array
리턴 array Bidirectional object names

data() 공개 메소드

Get the data from the field
부터: 2.0
public data ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null, boolean $in_form = true ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
$in_form boolean
리턴 array Array of possible field data

data_capabilities() 공개 메소드

Data callback for User Capabilities
부터: 2.3
public data_capabilities ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_countries() 공개 메소드

Data callback for Countries
부터: 2.3
public data_countries ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_days_of_week() 공개 메소드

Data callback for US States
부터: 2.3
public data_days_of_week ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_image_sizes() 공개 메소드

Data callback for Image Sizes
부터: 2.3
public data_image_sizes ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_months_of_year() 공개 메소드

Data callback for US States
부터: 2.3
public data_months_of_year ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_post_stati() 공개 메소드

Data callback for Post Stati
부터: 2.3
public data_post_stati ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_roles() 공개 메소드

Data callback for User Roles
부터: 2.3
public data_roles ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

data_us_states() 공개 메소드

Data callback for US States
부터: 2.3
public data_us_states ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 array

delete() 공개 메소드

Delete the value from the DB
부터: 2.3
public delete ( integer $id = null, string $name = null, array $options = null, array $pod = null )
$id integer
$name string
$options array
$pod array

display() 공개 메소드

Change the way the value of the field is displayed with Pods::get
부터: 2.0
public display ( mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null )
$value mixed
$name string
$options array
$pod array
$id integer

get_field_data() 공개 메소드

Get available items from a relationship field
public get_field_data ( array | string $field, array $options = [], array $object_params = [] ) : array
$field array | string Field array or field name
$options array [optional] Field options array overrides
$object_params array [optional] Additional get_object_data options
리턴 array An array of available items from a relationship field

get_object_data() 공개 메소드

Get data from relationship objects
public get_object_data ( array $object_params = null ) : array | boolean
$object_params array Object data parameters
리턴 array | boolean Object data

input() 공개 메소드

Customize output of the form field
부터: 2.0
public input ( string $name, mixed $value = null, array $options = null, array $pod = null, integer $id = null )
$name string
$value mixed
$options array
$pod array
$id integer

options() 공개 메소드

Add options and set defaults to
부터: 2.0
public options ( ) : array
리턴 array

save() 공개 메소드

Save the value to the DB
부터: 2.3
public save ( mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null )
$value mixed
$id integer
$name string
$options array
$fields array
$pod array
$params object

schema() 공개 메소드

Define the current field's schema for DB table storage
부터: 2.0
public schema ( array $options = null ) : array
$options array
리턴 array

simple_objects() 공개 메소드

Return available simple object names
부터: 2.3
public simple_objects ( ) : array
리턴 array Simple object names

simple_value() 공개 메소드

Convert a simple value to the correct value
public simple_value ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null, boolean $raw = false ) : mixed
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
$raw boolean Whether to return the raw list of keys (true) or convert to key=>value (false)
리턴 mixed Corrected value

ui() 공개 메소드

Customize the Pods UI manage table column output
부터: 2.0
public ui ( integer $id, mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null )
$id integer
$value mixed
$name string
$options array
$fields array
$pod array

validate() 공개 메소드

Validate a value before it's saved
부터: 2.0
public validate ( mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null, integer $id = null, null $params = null ) : array | boolean
$value mixed
$name string
$options array
$fields array
$pod array
$id integer
$params null
리턴 array | boolean

value_to_label() 공개 메소드

Get the label from a pick value
부터: 2.2
public value_to_label ( string $name, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : string
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 string

프로퍼티 상세

$api 보호되어 있는 정적으로 프로퍼티

API caching for fields that need it during validate/save
부터: 2.3
protected static PodsAPI $api
리턴 PodsAPI

$field_data 공개적으로 정적으로 프로퍼티

Data used during input method (mainly for autocomplete)
부터: 2.3
public static array $field_data
리턴 array

$group 공개적으로 정적으로 프로퍼티

Field Type Group
부터: 2.0
public static string $group
리턴 string

$label 공개적으로 정적으로 프로퍼티

Field Type Label
부터: 2.0
public static string $label
리턴 string

$type 공개적으로 정적으로 프로퍼티

Field Type Identifier
부터: 2.0
public static string $type
리턴 string