Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (19 loc) · 564 Bytes

CallableValidationMappingProvider.md

File metadata and controls

25 lines (19 loc) · 564 Bytes

CallableValidationMappingProvider

<?php

use Chubbyphp\Validation\Mapping\CallableValidationMappingProvider;
use MyProject\Mapping\ModelMapping;
use MyProject\Model\Model;

$mappingProvider = new CallableValidationMappingProvider(
    Model::class,
        function () {
        return new ModelMapping();
    }
);

$mappingProvider->getClass();
// \Namespace\To\Model

$mappingProvider->getValidationClassMapping('');
// ValidationClassMappingInterface[]

$mappingProvider->getValidationPropertyMappings('');
// ValidationPropertyMappingInterface[]