I have a model class file called
test.php
. I have two fields -
Function type
and
Service Type
. So, now I want to see that both
Function type
and
Service Type
are unique. i.e
Function type
and
Service Type
cannot be the same in more than one row.
I'm using the create and update function for this. I want both the functions to see if
Function type
and
Service Type
are repeated, then don’t save it and if not repeated then save it.
I'm using the below example to illustrate the rows -
ID Function type Service Type
1 2 3
2 4 5
3 7 8
How can I do this validation before saving. Please guide me on this.