PHP 클래스 sfFormPropel, sfPropelORMPlugin

저자: Fabien Potencier ([email protected])
상속: extends sfForm
파일 보기 프로젝트 열기: propelorm/sfPropelORMPlugin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$deleteField string Name of the field used for deletion.
$optionalForms array[sfForm] List of forms that can be added by the user

공개 메소드들

메소드 설명
__clone ( )
__construct ( $object = null, $options = [], $CSRFSecret = null ) Constructor.
addOptionalForms ( $taintedValues = null )
bind ( array $taintedValues = null, array $taintedFiles = null ) Binds the form with input values.
embedI18n ( array $cultures, string $decorator = null ) Embeds i18n objects into the current form.
embedRelation ( string $relationName, array $options = [] ) : sfPropelForm Embed a Collection form based on a Relation into this form.
getConnection ( ) : PropelPDO
getDeleteField ( )
getEmptyRelatedForm ( string $relationName, array $options = [] ) : sfFormPropel Get an empty Propel form based on a Relation of the current form's model.
getI18nFormClass ( ) : string Returns the name of the i18n form class.
getI18nModelName ( ) : string Returns the name of the i18n model.
getPeer ( ) : string Get the name of the Peer class of the form's model, e.g. 'AuthorPeer'
getRelationForm ( string $relationName, array $options = [] ) : sfFormPropelCollection Get a Collection form based on a Relation of the current form's model.
hasDeleteField ( )
isI18n ( ) : boolean Returns true if the current form has some associated i18n objects.
mergeForm ( sfForm $form ) Overrides sfForm::mergeForm() to also merge embedded forms Allows autosave of merged collections
mergeRelation ( string $relationName, array $options = [] ) : sfPropelForm Merge a Collection form based on a Relation into this form.
processValues ( $values ) Processes cleaned up values with user defined methods.
saveEmbeddedForms ( mixed $con = null, array $forms = null ) Saves embedded form objects.
setDeleteField ( $fieldName )
setDeleteWidget ( string $name, sfWidgetForm $widget ) : sfPropelForm Adds a widget to the form, and declare this widget as the delete control.

보호된 메소드들

메소드 설명
addEmptyRelationForm ( string $relationName, sfFormPropelCollection $relationForm, string $emptyName, string $prefix, array $options = [] ) Adds an empty Propel form based on a Relation of the current form's model to a collection form.
doSave ( mixed $con = null ) Updates and saves the current object.
doUpdateObject ( array $values ) Updates the values of the object with the cleaned up values.
getRelationFields ( $relationMap )
getRelationMap ( $relationName )
processUploadedFile ( string $field, string $filename = null, array $values = null ) : string Saves the uploaded file for the given field.
removeFile ( string $field ) Removes the current file for the field.
saveFile ( string $field, string $filename = null, sfValidatedFile $file = null ) : string Saves the current file for the field.
updateDefaultsFromObject ( ) Updates the default values of the form with the current values of the current object.

메소드 상세

__clone() 공개 메소드

public __clone ( )

__construct() 공개 메소드

Constructor.
또한 보기: sfForm
public __construct ( $object = null, $options = [], $CSRFSecret = null )

addEmptyRelationForm() 보호된 메소드

Available options: - add_empty: Whether to allow the user to add new objects to the collection. Defaults to true - max_additions: The maximum number of related objects that can be added. Defaults to 0 (no limit) - add_link: Text of the JS link that triggers the addition of the empty form. Defaults to 'Add new' - empty_decorator: decorator for the empty form
protected addEmptyRelationForm ( string $relationName, sfFormPropelCollection $relationForm, string $emptyName, string $prefix, array $options = [] )
$relationName string The name of a relation of the current Model, e.g. 'Book'
$relationForm sfFormPropelCollection The form to augment
$emptyName string The name of the empty form to add
$prefix string The prefix to ad to the empty name to form the key to the optional forms array
$options array An array of options

addOptionalForms() 공개 메소드

public addOptionalForms ( $taintedValues = null )

bind() 공개 메소드

It triggers the validator schema validation.
public bind ( array $taintedValues = null, array $taintedFiles = null )
$taintedValues array An array of input values
$taintedFiles array An array of uploaded files (in the $_FILES or $_GET format)

doSave() 보호된 메소드

Updates and saves the current object.
또한 보기: sfFormObject If you want to add some logic before saving or save other associated objects, this is the method to override.
protected doSave ( mixed $con = null )
$con mixed An optional connection object

doUpdateObject() 보호된 메소드

If you want to add some logic before updating or update other associated objects, this is the method to override.
또한 보기: sfFormObject
protected doUpdateObject ( array $values )
$values array An array of values

embedI18n() 공개 메소드

Embeds i18n objects into the current form.
public embedI18n ( array $cultures, string $decorator = null )
$cultures array An array of cultures
$decorator string A HTML decorator for the embedded form

embedRelation() 공개 메소드

Available options: - title: The title of the collection form once embedded. Defaults to the relation name. - decorator: The decorator for the sfWidgetFormSchemaDecorator - add_empty: Whether to allow the user to add new objects to the collection. Defaults to true - empty_label: Label showed to create a new related item. By default is new + name of the relation Additional options are passed to sfFromPropel::getRelationForm()
public embedRelation ( string $relationName, array $options = [] ) : sfPropelForm
$relationName string The name of a relation of the current Model, e.g. 'Book'
$options array An array of options
리턴 sfPropelForm The current form instance

getConnection() 공개 메소드

또한 보기: sfFormObject
public getConnection ( ) : PropelPDO
리턴 PropelPDO

getDeleteField() 공개 메소드

public getDeleteField ( )

getEmptyRelatedForm() 공개 메소드

Available options: - embedded_form_class: The class of the form to return - empty_label: The label of the empty form
public getEmptyRelatedForm ( string $relationName, array $options = [] ) : sfFormPropel
$relationName string The name of a relation of the current Model, e.g. 'Book'
$options array An array of options
리턴 sfFormPropel A Propel form instance

getI18nFormClass() 공개 메소드

Returns the name of the i18n form class.
public getI18nFormClass ( ) : string
리턴 string The name of the i18n form class

getI18nModelName() 공개 메소드

Returns the name of the i18n model.
public getI18nModelName ( ) : string
리턴 string The name of the i18n model

getPeer() 공개 메소드

Get the name of the Peer class of the form's model, e.g. 'AuthorPeer'
public getPeer ( ) : string
리턴 string A Peer class name

getRelationFields() 보호된 메소드

protected getRelationFields ( $relationMap )

getRelationForm() 공개 메소드

Available options: - hide_on_new: If true, returns null for new objects. Defaults to false. - collection_form_class: class of the collection form to return. Defaults to sfFormPropelCollection. - criteria: Optional criteria to filter related objects Additional options are passed to sfFormPropelCollection::__construct()
public getRelationForm ( string $relationName, array $options = [] ) : sfFormPropelCollection
$relationName string The name of a relation of the current Model, e.g. 'Book'
$options array An array of options
리턴 sfFormPropelCollection A form collection instance

getRelationMap() 보호된 메소드

protected getRelationMap ( $relationName )

hasDeleteField() 공개 메소드

public hasDeleteField ( )

isI18n() 공개 메소드

Returns true if the current form has some associated i18n objects.
public isI18n ( ) : boolean
리턴 boolean true if the current form has some associated i18n objects, false otherwise

mergeForm() 공개 메소드

Overrides sfForm::mergeForm() to also merge embedded forms Allows autosave of merged collections
public mergeForm ( sfForm $form )
$form sfForm The sfForm instance to merge with current form

mergeRelation() 공개 메소드

Available options: - add_empty: Whether to allow the user to add new objects to the collection. Defaults to true Additional options are passed to sfFromPropel::getRelationForm()
public mergeRelation ( string $relationName, array $options = [] ) : sfPropelForm
$relationName string The name of a relation of the current Model, e.g. 'Book'
$options array An array of options
리턴 sfPropelForm The current form instance

processUploadedFile() 보호된 메소드

Saves the uploaded file for the given field.
protected processUploadedFile ( string $field, string $filename = null, array $values = null ) : string
$field string The field name
$filename string The file name of the file to save
$values array An array of values
리턴 string The filename used to save the file

processValues() 공개 메소드

To process a value before it is used by the updateObject() method, you need to define an updateXXXColumn() method where XXX is the PHP name of the column. The method must return the processed value or false to remove the value from the array of cleaned up values.
또한 보기: sfFormObject
public processValues ( $values )

removeFile() 보호된 메소드

Removes the current file for the field.
protected removeFile ( string $field )
$field string The field name

saveEmbeddedForms() 공개 메소드

Saves embedded form objects.
또한 보기: sfFormObject
public saveEmbeddedForms ( mixed $con = null, array $forms = null )
$con mixed An optional connection object
$forms array An array of forms

saveFile() 보호된 메소드

Saves the current file for the field.
protected saveFile ( string $field, string $filename = null, sfValidatedFile $file = null ) : string
$field string The field name
$filename string The file name of the file to save
$file sfValidatedFile The validated file to save
리턴 string The filename used to save the file

setDeleteField() 공개 메소드

public setDeleteField ( $fieldName )

setDeleteWidget() 공개 메소드

If the bound widget value is true, then the related object will be deleted
public setDeleteWidget ( string $name, sfWidgetForm $widget ) : sfPropelForm
$name string The field name
$widget sfWidgetForm The widget
리턴 sfPropelForm The current form instance

updateDefaultsFromObject() 보호된 메소드

Updates the default values of the form with the current values of the current object.
protected updateDefaultsFromObject ( )

프로퍼티 상세

$deleteField 보호되어 있는 프로퍼티

Name of the field used for deletion.
protected string $deleteField
리턴 string

$optionalForms 보호되어 있는 프로퍼티

List of forms that can be added by the user
protected array[sfForm] $optionalForms
리턴 array[sfForm]