Thanks to visit codestin.com
Credit goes to github.com

Skip to content

When constraint- Pass context and root to the list of available variables for expression language #58511

Closed
@KoNekoD

Description

@KoNekoD

Description

I encountered a problem with validation of nested entities and I needed to validate by parent field, if draft true then no validation is needed

Example fix-feature for my case study:

$variables['value'] = $value;
$variables['this'] = $context->getObject();
$variables['context'] = $context;
$variables['root'] = $context->getRoot();

What do you think about me creating a Pull Request with this addition?

Example

$variables['value'] = $value;
$variables['this'] = $context->getObject();
$variables['context'] = $context;
$variables['root'] = $context->getRoot();

\Symfony\Component\Validator\Constraints\WhenValidator

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions