symfony API

sfFormPropel Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfFormPropel is the base class for forms based on Propel objects.

Inheritence

sfFormPropel  <  sfForm

Method Summary

  • Boolean bindAndSave($taintedValues, $taintedFiles, $con)
    Binds the current form and save the to the database in one step.
  • doSave($con)
    Updates and saves the current object.
  • embedI18n($cultures, $decorator)
    Embeds i18n objects into the current form.
  • Connection getConnection()
    Returns the default connection for the current model.
  • string getI18nFormClass()
    Returns the name of the i18n form class.
  • string getI18nModelName()
    Returns the name of the i18n model.
  • getModelName()
    Returns the current model name.
  • BaseObject getObject()
    Returns the current object for this form.
  • Boolean isI18n()
    Returns true if the current form has some associated i18n objects.
  • Boolean isNew()
    Returns true if the current form embeds a new object.
  • BaseObject save($con)
    Saves the current object to the database.
  • updateDefaultsFromObject()
    Updates the default values of the form with the current values of the current object.
  • updateI18nObjects($con)
    Updates the associated i18n objects values.
  • BaseObject updateObject()
    Updates the values of the object with the cleaned up values.
  • __construct($object, $options, $CSRFSecret)
    Constructor.

Methods inherited from sfForm

addCSRFProtection , bind , configure , convertFileInformation , deepArrayUnion , disableCSRFProtection , embedForm , embedFormForEach , enableCSRFProtection , fixPhpFilesArray , getCSRFFieldName , getCSRFToken , getDefault , getDefaults , getErrorSchema , getFormFieldSchema , getGlobalErrors , getOption , getToStringException , getValidatorSchema , getValue , getValues , getWidgetSchema , hasDefault , hasGlobalErrors , hasToStringException , isBound , isCSRFProtected , isMultipart , isValid , mergeForm , mergePostValidator , mergePreValidator , offsetExists , offsetGet , offsetSet , offsetUnset , render , renderGlobalErrors , resetFormFields , setCSRFFieldName , setDefault , setDefaults , setOption , setToStringException , setup , setValidators , setValidatorSchema , setWidgets , setWidgetSchema , __clone , __construct , __toString

Method Details

  • (Boolean) bindAndSave ($taintedValues, $taintedFiles, $con) Browse code

    $taintedValues An array of tainted values to use to bind the form
    $taintedFiles An array of uploaded files (in the $_FILES or $_GET format)
    $con An optional Propel Connection object

    Binds the current form and save the to the database in one step.

    returns true if the form is valid, false otherwise

  • doSave ($con) Browse code

    $con An optional Connection object

    Updates and saves the current object.


    If you want to add some logic before saving or save other associated objects,
    this is the method to override.

  • embedI18n ($cultures, $decorator) Browse code

    $cultures An array of cultures
    $decorator A HTML decorator for the embedded form

    Embeds i18n objects into the current form.

  • (Connection) getConnection () Browse code

    Returns the default connection for the current model.

    returns A database connection

  • (string) getI18nFormClass () Browse code

    Returns the name of the i18n form class.

    returns The name of the i18n form class

  • (string) getI18nModelName () Browse code

    Returns the name of the i18n model.

    returns The name of the i18n model

  • getModelName () Browse code

    Returns the current model name.

  • (BaseObject) getObject () Browse code

    Returns the current object for this form.

    returns The current object.

  • (Boolean) isI18n () Browse code

    Returns true if the current form has some associated i18n objects.

    returns true if the current form has some associated i18n objects, false otherwise

  • (Boolean) isNew () Browse code

    Returns true if the current form embeds a new object.

    returns true if the current form embeds a new object, false otherwise

  • (BaseObject) save ($con) Browse code

    $con An optional Connection object

    Saves the current object to the database.


    The object saving is done in a transaction and handled by the doSave() method.

    If the form is not valid, it throws an sfValidatorError.

    returns The current saved object

  • updateDefaultsFromObject () Browse code

    Updates the default values of the form with the current values of the current object.

  • updateI18nObjects ($con) Browse code

    $con An optional Connection object

    Updates the associated i18n objects values.

  • (BaseObject) updateObject () Browse code

    Updates the values of the object with the cleaned up values.

    returns The current updated object

  • __construct ($object, $options, $CSRFSecret) Browse code

    $object A Propel object used to initialize default values
    $options An array of options
    $CSRFSecret A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret)

    Constructor.