CascadingEntity example

'groups' => 'Group',
        ]));

        $violations = $this->validate($entitynew Valid(), 'Group');

        /* @var ConstraintViolationInterface[] $violations */
        $this->assertCount(0, $violations);
    }

    public function testTypedReferenceCascadeEnabled()
    {
        $entity = new CascadingEntity();
        $entity->requiredChild = new CascadedChild();

        $callback = function D$value, ExecutionContextInterface $context) {
            $context->buildViolation('Invalid child')
                ->atPath('name')
                ->addViolation()
            ;
        };

        $cascadingMetadata = new ClassMetadata(CascadingEntity::class);
        $cascadingMetadata->addConstraint(new Cascade());

        
Home | Imprint | This part of the site doesn't use cookies.