
Public Member Functions | |
| __construct ($typeName=NULL, $memberName=NULL, $caseSensitive=false, $ignoredIds=array()) | |
| Constructor. | |
| showJsValidationString ($typePath, $messagePrefix) | |
| Prints javascript for this validator. | |
| validate ($messagePrefix, $value) | |
| Does the validation. | |
Protected Attributes | |
| $typeName | |
| The name of the type of which the member must be uniqe. | |
| $memberName | |
The member name which must be unique within the objects of $typeName. | |
| $caseSensitive | |
| Whether the comparison should be case-sensitive. | |
| $ignoredIds | |
| Ids that can be ignored in the query. | |
This is called UniqueMemberValidator since it is mostly used to assure that a value does not exist in the database before inserting a new object, thus assuring the newly inserted value is unique.
Definition at line 9 of file UniqueMemberValidator.class.php.
| spunQ_UniqueMemberValidator::__construct | ( | $ | typeName = NULL, |
|
| $ | memberName = NULL, |
|||
| $ | caseSensitive = false, |
|||
| $ | ignoredIds = array() | |||
| ) |
Constructor.
| $typeName | Name of the type the $member belongs to. | |
| $memberName | Name of the member that should not exist in the database. | |
| $caseSensitive | Whether the comparison should be case-sensitive. Setting this to true will make sure that no two users with two distinct names admin and admiN are registered, for example. | |
| $ignoredIds | Array of ignored ids. |
Definition at line 48 of file UniqueMemberValidator.class.php.
| spunQ_UniqueMemberValidator::showJsValidationString | ( | $ | typePath, | |
| $ | messagePrefix | |||
| ) |
Prints javascript for this validator.
Should make use a call to the spunQ javascript function spunQ.form.registerValidator().
| $messagePrefix | A string to prepend to the error message key. |
Implements spunQ_IFieldValidator.
Definition at line 63 of file UniqueMemberValidator.class.php.
| spunQ_UniqueMemberValidator::validate | ( | $ | messagePrefix, | |
| $ | value | |||
| ) |
Does the validation.
| $messagePrefix | A string to prepend to the error message key. | |
| $value | The spunQ value to validate. |
NULL if the value was valid. Implements spunQ_IFieldValidator.
Definition at line 70 of file UniqueMemberValidator.class.php.
spunQ_UniqueMemberValidator::$caseSensitive [protected] |
Whether the comparison should be case-sensitive.
Setting this to true will make sure that no two users with two distinct names admin and admiN are registered, for example.
Definition at line 29 of file UniqueMemberValidator.class.php.
spunQ_UniqueMemberValidator::$ignoredIds [protected] |
Ids that can be ignored in the query.
This will be needed if a stored object is being updated.
Definition at line 36 of file UniqueMemberValidator.class.php.
spunQ_UniqueMemberValidator::$memberName [protected] |
The member name which must be unique within the objects of $typeName.
Definition at line 21 of file UniqueMemberValidator.class.php.
spunQ_UniqueMemberValidator::$typeName [protected] |
The name of the type of which the member must be uniqe.
Definition at line 15 of file UniqueMemberValidator.class.php.
1.5.9