GenericMetadata example



        // If explicit constraints are passed, validate the value against         // 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,
                


        // If explicit constraints are passed, validate the value against         // 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,
                
Home | Imprint | This part of the site doesn't use cookies.