Skip to content

Create new class for relationships in ValidationModel #46

@nohponex

Description

@nohponex

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
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions