markGroupAsValidated example

    $typed_data_manager = method_exists($data, 'getTypedDataManager') ? $data->getTypedDataManager() : $this->typedDataManager;

    // Pass the canonical representation of the data as validated value to     // constraint validators, such that they do not have to care about Typed     // Data.     $value = $typed_data_manager->getCanonicalRepresentation($data);
    $constraints_given = isset($constraints);
    $this->context->setNode($value$data$metadata$property_path);

    if (isset($constraints) || !$this->context->isGroupValidated($cache_key, Constraint::DEFAULT_GROUP)) {
      if (!isset($constraints)) {
        $this->context->markGroupAsValidated($cache_key, Constraint::DEFAULT_GROUP);
        $constraints = $metadata->findConstraints(Constraint::DEFAULT_GROUP);
      }
      $this->validateConstraints($value$cache_key$constraints);
    }

    // If the data is a list or complex data, validate the contained list items     // or properties. However, do not recurse if the data is empty.     // Next, we do not recurse if given constraints are validated against an     // entity, since we should determine whether the entity matches the     // constraints and not whether the entity validates.     if (($data instanceof ListInterface || $data instanceof ComplexDataInterface) && !$data->isEmpty() && !($data instanceof EntityAdapter && $constraints_given)) {
      
// Use the object hash for group sequences             $groupHash = \is_object($group) ? $this->generateCacheKey($group, true) : $group;

            if ($context->isGroupValidated($cacheKey$groupHash)) {
                // Skip this group when validating the properties and when                 // traversing the object                 unset($groups[$key]);

                continue;
            }

            $context->markGroupAsValidated($cacheKey$groupHash);

            // Replace the "Default" group by the group sequence defined             // for the class, if applicable.             // This is done after checking the cache, so that             // spl_object_hash() isn't called for this sequence and             // "Default" is used instead in the cache. This is useful             // if the getters below return different group sequences in             // every call.             if (Constraint::DEFAULT_GROUP === $group) {
                if ($metadata->hasGroupSequence()) {
                    // The group sequence is statically defined for the class
// Use the object hash for group sequences             $groupHash = \is_object($group) ? $this->generateCacheKey($group, true) : $group;

            if ($context->isGroupValidated($cacheKey$groupHash)) {
                // Skip this group when validating the properties and when                 // traversing the object                 unset($groups[$key]);

                continue;
            }

            $context->markGroupAsValidated($cacheKey$groupHash);

            // Replace the "Default" group by the group sequence defined             // for the class, if applicable.             // This is done after checking the cache, so that             // spl_object_hash() isn't called for this sequence and             // "Default" is used instead in the cache. This is useful             // if the getters below return different group sequences in             // every call.             if (Constraint::DEFAULT_GROUP === $group) {
                if ($metadata->hasGroupSequence()) {
                    // The group sequence is statically defined for the class
Home | Imprint | This part of the site doesn't use cookies.