src/Form/FormDataConstraintFinder.php
private function resolveDataSource(FormInterface $form)
    {
        if ($form->isRoot()) {
            // Nothing to do if root
            $dataForm = $form->getData();
        } else {
            $dataForm = $form;
            while ($dataForm->getConfig()->getDataClass() === null) {
                $dataForm = $form->getParent();
            }
        }

        $data = $dataForm->getData();
        return array(
            $data,
            $data === null ? $dataForm->getConfig()->getDataClass() : get_class($data)
        );
    }
private function resolveDataSource(FormInterface $form)
    {
        if ($form->isRoot()) {
            // Nothing to do if root
            $dataForm = $form->getData();
        } else {
            $dataForm = $form;
            while ($dataForm->getConfig()->getDataClass() === null) {
                $dataForm = $form->getParent();
            }
        }

        $data = $dataForm->getData();
        return array(
            $data,
            $data === null ? $dataForm->getConfig()->getDataClass() : get_class($data)
        );
    }
private function resolveDataSource ( FormInterface $ form ) { if ( $ form -> isRoot ( ) ) { // Nothing to do if root $ dataForm = $ form -> getData ( ) ; } else { $ dataForm = $ form ; while ( $ dataForm -> getConfig ( ) -> getDataClass ( ) === null ) { $ dataForm = $ form -> getParent ( ) ; } } $ data = $ dataForm -> getData ( ) ; return array ( $ data , $ data === null ? $ dataForm -> getConfig ( ) -> getDataClass ( ) : get_class ( $ data ) ) ; }
Gets the form data to which a property path applies

@param FormInterface $form
@return object|null
Gets the form data to which a property path applies