symfony API

sfFormPropel Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

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

Inheritence

sfFormPropel  <  sfForm

Method Summary

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

Methods inherited from sfForm

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

Method Details

  • __construct ($object = null, $options = array(), $CSRFSecret = null)

    $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.

  • updateI18nObjects ((Connection) $con)

    $con An optional Connection object

    Updates the associated i18n objects values.

  • (Boolean) bindAndSave ($taintedValues, $taintedFiles = null, (Connection) $con = null)

    $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

  • getModelName ()

    Returns the current model name.

  • (Boolean) isI18n ()

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

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

  • (BaseObject) save ((Connection) $con = null)

    $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

  • (string) getI18nFormClass ()

    Returns the name of the i18n form class.

    returns The name of the i18n form class

  • (BaseObject) updateObject ()

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

    returns The current updated object

  • embedI18n ($cultures, $nameFormat = null, $decorator = null)

    $cultures An array of cultures
    $nameFormat The format to use for widget name
    $decorator A HTML decorator for the embedded form

    Embeds i18n objects into the current form.

  • (string) getI18nModelName ()

    Returns the name of the i18n model.

    returns The name of the i18n model

  • (BaseObject) getObject ()

    Returns the current object for this form.

    returns The current object.

  • (Boolean) isNew ()

    Returns true if the current form embeds a new object.

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

  • updateDefaultsFromObject ()

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

  • (Connection) getConnection ()

    Returns the default connection for the current model.

    returns A database connection

  • doSave ((Connection) $con = null)

    $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.