Turn Mjoin a required field
Turn Mjoin a required field
itarodrigo
Posts: 15Questions: 6Answers: 0
in Editor
I have the code
->join(
Mjoin::inst('tb_perfil')
->link('tb_usuario.id', 'rl_usuario_perfil.usuario_id')
->link('tb_perfil.id', 'rl_usuario_perfil.perfil_id')
->fields(
Field::inst('id')
->validator('Validate::required'),
Field::inst('descricao')
)
)
But this field is not required on the register. How to set the Mjoin filter to be required?
This question has an accepted answers - jump to answer
Answers
Use the
mjoinMinCount
validator.Allan
This works:
But this not works:
The code not show any error, but not works. How to create a custom messagem?
The two Mjoin validators actually don't take a
ValidateOptions
class as their second parameter - it is just a string:should do it.
Allan