Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pomm Unique Object Validator #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hadrien45
Copy link

Following this Issue pomm-project/pomm-bundle#53

Copy link
Member

@chanmix51 chanmix51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a comprehensive description of what this validator does since it does not just check uniqueness on primary key.

$params[] = $object->$method();

if(end($fields) !== $f){
$query_string.= $f.' = $* AND ';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’d be better to use the Where class to handle that.

@Hadrien45
Copy link
Author

Hi,

This validator allows me to check that a record in a table does not exist (I can check one or many fields).
For example I have a Posts table with two fields ("id", "name") and I want to check with the Symfony Form that the Posts table have not a record with the same "name".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants