symfony API

sfValidatorPropelUnique Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 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.

sfValidatorPropelUnique validates that the uniqueness of a column.


sfValidatorPropelUnique  <  sfValidatorSchema < sfValidatorBase

Method Summary

  • configure()
    Configures the current validator.
  • doClean()
    @see sfValidatorBase
  • array getPrimaryKeys()
    Returns the primary keys for the model.
  • Boolean isUpdate($object, $values)
    Returns whether the object is being updated.
  • __construct($options, $messages)

Methods inherited from sfValidatorSchema

asString , clean , configure , doClean , getBytes , getFields , getPostValidator , getPreValidator , offsetExists , offsetGet , offsetSet , offsetUnset , postClean , preClean , setPostValidator , setPreValidator , __clone , __construct

Methods inherited from sfValidatorBase

addMessage , addOption , addRequiredOption , asString , clean , configure , doClean , getCharset , getDefaultMessages , getDefaultOptions , getEmptyValue , getErrorCodes , getMessage , getMessages , getMessagesWithoutDefaults , getOption , getOptions , getOptionsWithoutDefaults , getRequiredOptions , hasOption , isEmpty , setCharset , setDefaultMessage , setDefaultMessages , setDefaultOptions , setMessage , setMessages , setOption , setOptions , __construct

Method Details

  • configure ()

    Configures the current validator.

    Available options:

    * model: The model class (required)
    * column: The unique column name in Propel field name format (required)
    If the uniqueness is for several columns, you can pass an array of field names
    * field Field name used by the form, other than the column name
    * primary_key: The primary key column name in Propel field name format (optional, will be introspected if not provided)
    You can also pass an array if the table has several primary keys
    * connection: The Propel connection to use (null by default)
    * throw_global_error: Whether to throw a global error (false by default) or an error tied to the first field related to the column option array

  • doClean ()

    @see sfValidatorBase

  • (array) getPrimaryKeys ()

    Returns the primary keys for the model.

    returns An array of primary keys

  • (Boolean) isUpdate ($object, $values)

    $object A Propel object
    $values An array of values

    Returns whether the object is being updated.

    returns true if the object is being updated, false otherwise

  • __construct ($options, $messages)

    $options An array of options
    $messages An array of error messages