symfony API

sfFormObject Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

Base class for forms that deal with a single object.

Inheritence

sfFormPropel, sfFormDoctrine  <  sfFormObject

Method Summary

  • Boolean bindAndSave(, , )
    Binds the current form and saves the object to the database in one step.
  • camelize()
  • doSave($con)
    Updates and saves the current object.
  • doUpdateObject($values)
    Updates the values of the object with the cleaned up values.
  • mixed getConnection()
    Returns the default connection for the current model.
  • string getModelName()
    Returns the current model name.
  • mixed getObject()
    Returns the current object for this form.
  • Boolean isNew()
    Returns true if the current form embeds a new object.
  • array processValues($values)
    Processes cleaned up values.
  • string renderFormTag($url, $attributes)
    Renders a form tag suitable for the related object.
  • mixed save($con)
    Saves the current object to the database.
  • saveEmbeddedForms($con, $forms)
    Saves embedded form objects.
  • mixed updateObject($values)
    Updates the values of the object with the cleaned up values.
  • updateObjectEmbeddedForms($values, $forms)
    Updates the values of the objects in embedded forms.

Method Details

  • (Boolean) bindAndSave (, , ) Browse code

    Binds the current form and saves the object to the database in one step.

    returns true if the form is valid, false otherwise

  • camelize () Browse code

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

  • doUpdateObject ($values) Browse code

    $values An array of values

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


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

  • (mixed) getConnection () Browse code

    Returns the default connection for the current model.

    returns A database connection

  • (string) getModelName () Browse code

    Returns the current model name.

  • (mixed) getObject () Browse code

    Returns the current object for this form.

    returns The current object

  • (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

  • (array) processValues ($values) Browse code

    $values An array of values

    Processes cleaned up values.

    returns An array of cleaned up values

  • (string) renderFormTag ($url, $attributes) Browse code

    $url The URL for the action
    $attributes An array of HTML attributes

    Renders a form tag suitable for the related object.


    The method is automatically guessed based on the Doctrine object:

    * if the object is new, the method is POST
    * if the object already exists, the method is PUT

    returns An HTML representation of the opening form tag

  • (mixed) 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.

    returns The current saved object

    throws sfValidatorError If the form is not valid

  • saveEmbeddedForms ($con, $forms) Browse code

    $con An optional connection object
    $forms An array of forms

    Saves embedded form objects.

  • (mixed) updateObject ($values) Browse code

    $values An array of values

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

    returns The current updated object

  • updateObjectEmbeddedForms ($values, $forms) Browse code

    $values An array of values
    $forms An array of forms

    Updates the values of the objects in embedded forms.