- or download this
<table name="foo">
<field name="a" required="1"/>
<field name="b" validate="\d+\.\d+\.\d+"/>
<field name="c" required="if a"/>
</table>
- or download this
package Model::Validate::Foo;
...
die "c is required if a" if $value_of{a};
}
}
- or download this
<table name="foo">
...
<constraint name="avg_a" value="average(a) > 100"/>
</table>
- or download this
sub avg_a {
# called on insert, update of table foo
# check if average(a) > 100
}