Skip to content

Commit e9affa9

Browse files
committed
More Validator documentation
1 parent 319261e commit e9affa9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/PHPFUI/ORM/Validator.php

+15
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@
8484
* * eq_field
8585
* * neq_field
8686
*
87+
* **Example:**
88+
* ```php
89+
* class Event extends \PHPFUI\ORM\Validator
90+
* {
91+
* public static array $validators = [
92+
* 'endTime' => ['maxlength', 'gt_field:startTime'],
93+
* 'lastRegistrationDate' => ['required', 'date', 'lte_field:eventDate'],
94+
* 'newMemberDiscount' => ['required', 'number', 'lte_field:price'],
95+
* 'publicDate' => ['date', 'lte_field:registrationStartDate', 'lte_field:eventDate'],
96+
* 'registrationStartDate' => ['date', 'lte_field:lastRegistrationDate', 'lte_field:eventDate'],
97+
* 'startTime' => ['maxlength', 'lt_field:endTime'],
98+
* ];
99+
* }
100+
* ```
101+
*
87102
* Field validators take another field name as a parameter and perform the specified condition test. To compare against a specific value, use minvalue, maxvalue, equal or not_equal.
88103
*
89104
* ## Unique Parameters

0 commit comments

Comments
 (0)