| 1 | <?php  | 
            ||
| 9 | class FooSchema extends SchemaValidator  | 
            ||
| 10 | { | 
            ||
| 11 | protected $fields = [  | 
            ||
| 12 | '_id' => [  | 
            ||
| 13 | 'unique' => true,  | 
            ||
| 14 | 'validator' => [  | 
            ||
| 15 | 'class' => StringValidator::class,  | 
            ||
| 16 | ]  | 
            ||
| 17 | ],  | 
            ||
| 18 | 'title' => [  | 
            ||
| 19 | 'unique' => true,  | 
            ||
| 20 | 'required' => true,  | 
            ||
| 21 | 'validator' => [  | 
            ||
| 22 | 'class' => StringValidator::class,  | 
            ||
| 23 | 'params' => [  | 
            ||
| 24 | 'maxLength' => 100,  | 
            ||
| 25 | ],  | 
            ||
| 26 | ],  | 
            ||
| 27 | ],  | 
            ||
| 28 | 'status' => [  | 
            ||
| 29 | 'default' => 0,  | 
            ||
| 30 | 'validator' => [  | 
            ||
| 31 | 'class' => IntegerValidator::class,  | 
            ||
| 32 | 'params' => [  | 
            ||
| 33 | 'min' => 0,  | 
            ||
| 34 | 'max' => 1,  | 
            ||
| 35 | ],  | 
            ||
| 36 | ],  | 
            ||
| 37 | ],  | 
            ||
| 38 | 'bar' => [  | 
            ||
| 39 | 'type' => BarSchema::class,  | 
            ||
| 40 | ],  | 
            ||
| 41 | ];  | 
            ||
| 42 | |||
| 43 | public function __construct()  | 
            ||
| 49 | }  | 
            ||
| 50 |