validateGenericNode example

        // those constraints         if (null !== $constraints) {
            // You can pass a single constraint or an array of constraints             // Make sure to deal with an array in the rest of the code             if (!\is_array($constraints)) {
                $constraints = [$constraints];
            }

            $metadata = new GenericMetadata();
            $metadata->addConstraints($constraints);

            $this->validateGenericNode(
                $value,
                $previousObject,
                \is_object($value) ? $this->generateCacheKey($value) : null,
                $metadata,
                $this->defaultPropertyPath,
                $groups,
                null,
                TraversalStrategy::IMPLICIT,
                $this->context
            );

            
        // those constraints         if (null !== $constraints) {
            // You can pass a single constraint or an array of constraints             // Make sure to deal with an array in the rest of the code             if (!\is_array($constraints)) {
                $constraints = [$constraints];
            }

            $metadata = new GenericMetadata();
            $metadata->addConstraints($constraints);

            $this->validateGenericNode(
                $value,
                $previousObject,
                \is_object($value) ? $this->generateCacheKey($value) : null,
                $metadata,
                $this->defaultPropertyPath,
                $groups,
                null,
                TraversalStrategy::IMPLICIT,
                $this->context
            );

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