isGroupValidated example

    // if it is available. This is necessary for specialized typed data objects,     // for example those using the typed config subclass of the manager.     $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


        foreach ($groups as $key => $group) {
            // If the "Default" group is replaced by a group sequence, remember             // to cascade the "Default" group when traversing the group             // sequence             $defaultOverridden = false;

            // 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.


        foreach ($groups as $key => $group) {
            // If the "Default" group is replaced by a group sequence, remember             // to cascade the "Default" group when traversing the group             // sequence             $defaultOverridden = false;

            // 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.
Home | Imprint | This part of the site doesn't use cookies.