Skip to content

"When" Constraint -> Possibility to apply validations if expression(s) not matched (same way as if/else) #57370

Closed
@Methraen

Description

@Methraen

Description

It would be useful to be able to apply constraints when "When" expression is not matched, same way as an if/else.

Example

So we could pass from this:

#[Assert\When('this.getProduct()?.getNature()?.value !== "SESSION"', new Assert\IsNull())]
#[Assert\When('this.getProduct()?.getNature()?.value === "SESSION"', new Assert\NotNull())]

To that:

#[Assert\When('this.getProduct()?.getNature()?.value !== "SESSION"', new Assert\IsNull(), new Assert\NotNull())]

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy