public function reverseTransform($array)
    {
        $id = ArrayUtils::get($array, 'id', null);
        $umbrellaFile = $id ? $this->em->getRepository(UmbrellaFile::class)->find($id) : null;
        $uploadedFile = ArrayUtils::get($array, 'file', null);
        $delete = ArrayUtils::get($array, 'delete', false);

        if ($umbrellaFile && $uploadedFile) { // update
            $this->em->remove($umbrellaFile);
            return $this->manager->createUmbrellaFile($uploadedFile);
        }

        if ($umbrellaFile && $uploadedFile === null && $delete) { // delete
            $this->em->remove($umbrellaFile);
            return null;
        }

        if ($umbrellaFile === null && $uploadedFile) { // create
            return $this->manager->createUmbrellaFile($uploadedFile);
        }

        // nothing to do
        return $umbrellaFile;
    }
public function reverseTransform($array)
    {
        $id = ArrayUtils::get($array, 'id', null);
        $umbrellaFile = $id ? $this->em->getRepository(UmbrellaFile::class)->find($id) : null;
        $uploadedFile = ArrayUtils::get($array, 'file', null);
        $delete = ArrayUtils::get($array, 'delete', false);

        if ($umbrellaFile && $uploadedFile) { // update
            $this->em->remove($umbrellaFile);
            return $this->manager->createUmbrellaFile($uploadedFile);
        }

        if ($umbrellaFile && $uploadedFile === null && $delete) { // delete
            $this->em->remove($umbrellaFile);
            return null;
        }

        if ($umbrellaFile === null && $uploadedFile) { // create
            return $this->manager->createUmbrellaFile($uploadedFile);
        }

        // nothing to do
        return $umbrellaFile;
    }
public function reverseTransform ( $ array ) { $ id = ArrayUtils :: get ( $ array , 'id' , null ) ; $ umbrellaFile = $ id ? $ this -> em -> getRepository ( UmbrellaFile :: class ) -> find ( $ id ) : null ; $ uploadedFile = ArrayUtils :: get ( $ array , 'file' , null ) ; $ delete = ArrayUtils :: get ( $ array , 'delete' , false ) ; if ( $ umbrellaFile && $ uploadedFile ) { // update $ this -> em -> remove ( $ umbrellaFile ) ; return $ this -> manager -> createUmbrellaFile ( $ uploadedFile ) ; } if ( $ umbrellaFile && $ uploadedFile === null && $ delete ) { // delete $ this -> em -> remove ( $ umbrellaFile ) ; return null ; } if ( $ umbrellaFile === null && $ uploadedFile ) { // create return $ this -> manager -> createUmbrellaFile ( $ uploadedFile ) ; } // nothing to do return $ umbrellaFile ; }
Transform array => UmbrellaFile

@param array $array
@return UmbrellaFile|null
Transform array = > UmbrellaFile