ObjectValidator is overkill when defining relationships in ValidationModel.
Although the generalized ObjectValidator might be useful for custom validators like (permissions check) etc
Perhaps we can keep ObjectValidator as $2 argument of ValidationModel and create the new class as helper method that bootstraps a default ObjectValidator based on it's constructor parameters
<?php
class RelationshipsValidator extends ObjectValidator
{
public function __construct(string[] $relationships, string[] $required)
{
//use parent::__construct
}
}
ObjectValidator is overkill when defining relationships in ValidationModel.
Although the generalized
ObjectValidator
might be useful for custom validators like (permissions check) etcPerhaps we can keep
ObjectValidator
as $2 argument of ValidationModel and create the new class as helper method that bootstraps a default ObjectValidator based on it's constructor parameters