In my database user_group table UNIQUE_KEY consist of two columns , user_id
and user_group_id
. This is how it looks like in propel schema :
<unique name="UNIQUE_KEY">
<unique-column name="user_id"/>
<unique-column name="user_group_id"/>
</unique>
If it is about one column then you can set validation behavior like below :
<behavior name="validate">
<parameter name="rule1"
value="{column: column_name, validator: Unique, options {message:Your validation message here.}}"/>
</behavior>
So what I wanted to know is how to set unique validation for key pair user_id
and user_group_id
. Is there any possibility to pass an array of column_names ?? Any suggestions will be appreciable. Thank you .