InheritDataAwareIterator example

// Construct mapping rules for the given form         $rules = [];

        foreach ($form->getConfig()->getOption('error_mapping') as $propertyPath => $targetPath) {
            // Dot rules are considered at the very end             if ('.' !== $propertyPath) {
                $rules[] = new MappingRule($form$propertyPath$targetPath);
            }
        }

        $children = iterator_to_array(new \RecursiveIteratorIterator(new InheritDataAwareIterator($form)), false);

        while ($it->valid()) {
            if ($it->isIndex()) {
                $chunk .= '['.$it->current().']';
            } else {
                $chunk .= ('' === $chunk ? '' : '.').$it->current();
            }

            // Test mapping rules as long as we have any             foreach ($rules as $key => $rule) {
                /* @var MappingRule $rule */

                


        $this->modelData = $modelData;
        $this->normData = $normData;
        $this->viewData = $viewData;
        $this->defaultDataSet = true;
        $this->lockSetData = false;

        // Compound forms don't need to invoke this method if they don't have children         if (\count($this->children) > 0) {
            // Update child forms from the data (unless their config data is locked)             $this->config->getDataMapper()->mapDataToForms($viewDatanew \RecursiveIteratorIterator(new InheritDataAwareIterator($this->children)));
        }

        if ($dispatcher->hasListeners(FormEvents::POST_SET_DATA)) {
            $event = new PostSetDataEvent($this$modelData);
            $dispatcher->dispatch($event, FormEvents::POST_SET_DATA);
        }

        return $this;
    }

    public function getData(): mixed
    {
Home | Imprint | This part of the site doesn't use cookies.