src/Form/Element/FileUpload.php
public function getFileEntity()
    {
        if (!$this->form || !($object = $this->form->getObject())) {
            return null;
        }

        if ($this->isMultiple()) {
            return $object;
        }

        $entityName = $this->getName();

        try {
            $fileEntity = $object->{"get" . $entityName}();
        } catch (\OutOfBoundsException $e) {
            return null;
        }

        return $fileEntity;
    }
public function getFileEntity()
    {
        if (!$this->form || !($object = $this->form->getObject())) {
            return null;
        }

        if ($this->isMultiple()) {
            return $object;
        }

        $entityName = $this->getName();

        try {
            $fileEntity = $object->{"get" . $entityName}();
        } catch (\OutOfBoundsException $e) {
            return null;
        }

        return $fileEntity;
    }
public function getFileEntity ( ) { if ( ! $ this -> form || ! ( $ object = $ this -> form -> getObject ( ) ) ) { return null ; } if ( $ this -> isMultiple ( ) ) { return $ object ; } $ entityName = $ this -> getName ( ) ; try { $ fileEntity = $ object -> { "get" . $ entityName } ( ) ; } catch ( \ OutOfBoundsException $ e ) { return null ; } return $ fileEntity ; }
Gets the file entity bound to the containing form,
Returns <i>NULL</i>, if the entity cannot be retrieved or is not set in the form.

@return null|Collection|\Core\Entity\FileInterface
Gets the file entity bound to the containing form Returns <i > NULL< / i > if the entity cannot be retrieved or is not set in the form .