Issue Feature Closed

#46462UniquenessValidator for models

Pascal Dürsteler 03/20/13, 13:54 updated 02/19/22, 10:07

Description

I am currently writing a UniquenessValidator and I wanted to publish this here, maybe someone has an Idea about functionalities and features. I also want to check if such a validator would be welcome in the core or not. Simple thing: It checks if there is already a value for that column available, usable for e.g. login-names, email-addresses etc. My thoughts so far:

Basic validator:

/** 
 * @validate Uniqueness
 */
protected $email;

Scoped checking, like: Each account can only have one user with that email-address, but the user can be there multiple times for different accounts.

/**
 * @validates Uniqueness(scope=user)
 */
protected $email;

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.