SilverStripeAustralia\Constraints\Constraints\UniqueConstraint
Ensures a data object has a unique field
- Author: <marcus@silverstripe.com.au>
- License: BSD License http://www.silverstripe.org/bsd-license
Synopsis
class UniqueConstraint
extends Constraint
{
- // Inherited members from Constraint
- protected $field;
- protected $object;
- protected $value;
- protected $options;
- // Inherited methods from Constraint
- public void __construct()
- protected void opt()
- public void setOption()
- public boolean holds()
- public string message()
- public string fieldLabel()
- public mixed getValue()
- public Constraint setValue()
Hierarchy
Members
protected
- $field
—
string
The field / key this constraint is applied to - $object
—
mixed
The object or array this should be applied to. - $options
—
array
Options for the constraints - $value
—
mixed
In some cases, the constraint may be applied directly to a value
Methods
public
Inherited from SilverStripeAustralia\Constraints\Constraint
protected
public
- fieldLabel() — Get the label for the field this constraint is bound to
- getValue() — Gets the value this constraint is testing
- holds() — Does this constraint hold up for the current state of $this->object ?
- message() — Get the message for when this constraint doesn't hold up
- setOption() — Set an option
- setValue() — Set the value being tested