Symfony2 API
Class

Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity

class UniqueEntity extends Constraint

Constraint for the Unique Entity validator

Properties

$message
$service
$em
$repositoryMethod
$fields
$errorPath
$ignoreNull

Methods

array getRequiredOptions()

Returns the name of the required options

string validatedBy()

Returns the name of the class that validates this constraint

string|array getTargets()

Returns whether the constraint can be put onto classes, properties or both

string getDefaultOption()

Returns the name of the default option

Details

at line 32
public array getRequiredOptions()

Returns the name of the required options

Override this method if you want to define required options.

Return Value

array

at line 42
public string validatedBy()

Returns the name of the class that validates this constraint

By default, this is the fully qualified name of the constraint class
suffixed with "Validator". You can override this method to change that
behaviour.

Return Value

string

at line 50
public string|array getTargets()

Returns whether the constraint can be put onto classes, properties or both

This method should return one or more of the constants
Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.

Return Value

string|array One or more constant values

at line 55
public string getDefaultOption()

Returns the name of the default option

Override this method to define a default option.

Return Value

string