PHP 인터페이스 Symfony\Component\Form\FieldInterface

저자: Bernhard Schussek ([email protected])
상속: extends Symfony\Component\Form\Localizable
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 0 사용 예제들

공개 메소드들

메소드 설명
__clone ( ) Clones this field.
addError ( Symfony\Component\Form\FieldError $error, Symfony\Component\Form\PropertyPathIterator $pathIterator = null, $type = null ) Recursively adds constraint violations to the fields
bind ( string | array $taintedData ) : boolean Binds POST data to the field, transforms and validates it.
getData ( ) : mixed Returns the normalized data of the field.
getDisplayedData ( ) : string | array Returns the data of the field as it is displayed to the user.
getId ( ) : string Returns the ID of the field.
getKey ( ) : string Returns the key by which the field is identified in field groups.
getName ( ) : string Returns the name of the field.
getParent ( ) : Symfony\Component\Form\FieldInterface Returns the parent field.
getPropertyPath ( ) : PropertyPath Returns the property path of the field
isBound ( ) : boolean Returns whether the field is bound.
isDisabled ( ) : boolean Returns whether this field is disabled
isHidden ( ) : boolean Returns whether the field is hidden
isMultipart ( ) : boolean Returns whether the field requires a multipart form.
isRequired ( ) : boolean Returns whether the field is required to be filled out.
isValid ( ) : boolean Returns whether the field is valid.
setData ( mixed $default ) Sets the default data
setKey ( string $key ) Sets the key by which the field is identified in field groups.
setParent ( Symfony\Component\Form\FieldInterface $parent = null ) Sets the parent field.
setPropertyPath ( string $propertyPath ) Sets the property path
setRequired ( boolean $required ) Sets whether this field is required to be filled out when submitted.
updateFromObject ( array | object &$objectOrArray ) Writes a property value of the object into the field
updateObject ( array | object &$objectOrArray ) Writes a the field value into a property of the object

메소드 상세

__clone() 공개 메소드

Clones this field.
public __clone ( )

addError() 공개 메소드

Violations in the form fields usually have property paths like: iterator[firstName].data iterator[firstName].displayedData iterator[Address].iterator[street].displayedData ... Violations in the form data usually have property paths like: data.firstName data.Address.street ...
public addError ( Symfony\Component\Form\FieldError $error, Symfony\Component\Form\PropertyPathIterator $pathIterator = null, $type = null )
$error Symfony\Component\Form\FieldError
$pathIterator Symfony\Component\Form\PropertyPathIterator

bind() 공개 메소드

Binds POST data to the field, transforms and validates it.
public bind ( string | array $taintedData ) : boolean
$taintedData string | array The POST data
리턴 boolean Whether the form is valid

getData() 공개 메소드

Returns the normalized data of the field.
public getData ( ) : mixed
리턴 mixed When the field is not bound, the default data is returned. When the field is bound, the normalized bound data is returned if the field is valid, null otherwise.

getDisplayedData() 공개 메소드

Returns the data of the field as it is displayed to the user.
public getDisplayedData ( ) : string | array
리턴 string | array When the field is not bound, the transformed default data is returned. When the field is bound, the bound data is returned.

getId() 공개 메소드

Returns the ID of the field.
public getId ( ) : string
리턴 string The ID of a field is equal to its name, where all sequences of squared brackets are replaced by a single underscore (e.g. if the name is "parent_name[field_key]", the ID is "parent_name_field_key").

getKey() 공개 메소드

Returns the key by which the field is identified in field groups.
public getKey ( ) : string
리턴 string The key of the field.

getName() 공개 메소드

Returns the name of the field.
public getName ( ) : string
리턴 string When the field has no parent, the name is equal to its key. If the field has a parent, the name is composed of the parent's name and the field's key, where the field's key is wrapped in squared brackets (e.g. "parent_name[field_key]")

getParent() 공개 메소드

Returns the parent field.
public getParent ( ) : Symfony\Component\Form\FieldInterface
리턴 Symfony\Component\Form\FieldInterface The parent field

getPropertyPath() 공개 메소드

Returns the property path of the field
public getPropertyPath ( ) : PropertyPath
리턴 PropertyPath

isBound() 공개 메소드

Returns whether the field is bound.
public isBound ( ) : boolean
리턴 boolean

isDisabled() 공개 메소드

The content of a disabled field is displayed, but not allowed to be modified. The validation of modified, disabled fields should fail. Fields whose parents are disabled are considered disabled regardless of their own state.
public isDisabled ( ) : boolean
리턴 boolean

isHidden() 공개 메소드

Returns whether the field is hidden
public isHidden ( ) : boolean
리턴 boolean

isMultipart() 공개 메소드

Returns whether the field requires a multipart form.
public isMultipart ( ) : boolean
리턴 boolean

isRequired() 공개 메소드

If the field has a parent and the parent is not required, this method will always return false. Otherwise the value set with setRequired() is returned.
public isRequired ( ) : boolean
리턴 boolean

isValid() 공개 메소드

Returns whether the field is valid.
public isValid ( ) : boolean
리턴 boolean

setData() 공개 메소드

Sets the default data
public setData ( mixed $default )
$default mixed The default data

setKey() 공개 메소드

Once this field is nested in a field group, i.e. after setParent() was called for the first time, this method should throw an exception.
public setKey ( string $key )
$key string The key of the field

setParent() 공개 메소드

Sets the parent field.
public setParent ( Symfony\Component\Form\FieldInterface $parent = null )
$parent Symfony\Component\Form\FieldInterface The parent field

setPropertyPath() 공개 메소드

The property path determines the property or a sequence of properties that a field updates in the data of the field group.
public setPropertyPath ( string $propertyPath )
$propertyPath string

setRequired() 공개 메소드

Sets whether this field is required to be filled out when submitted.
public setRequired ( boolean $required )
$required boolean

updateFromObject() 공개 메소드

The chosen property is determined by the field's property path.
public updateFromObject ( array | object &$objectOrArray )
$objectOrArray array | object

updateObject() 공개 메소드

The chosen property is determined by the field's property path.
public updateObject ( array | object &$objectOrArray )
$objectOrArray array | object