cakephp isUnique for 2 fields?

后端 未结 6 1613
醉梦人生
醉梦人生 2020-12-05 16:36

I have a registration form in which users can fill in two email address (email1 & email2). Marketing\'s requirement is that they need to be unique (unique as in if we ha

6条回答
  •  情深已故
    2020-12-05 17:24

    As far as I remember, you have to this kind of enforcement using the beforeSave method in the model. I had a requirement that an object have at least one of N fks set, and I could only do it this way.

    Edit: try this thread to see if anything there solves your problem.

提交回复
热议问题