# fluentform/5.2.9/app/Modules/Transfer/Transfer.php

Fluent Forms – Customizable Contact Forms, Survey, Quiz, &amp; Conversational Form Builder, version 5.2.9. 65 lines.

- Page: https://pluginprobe.com/plugins/fluentform/5.2.9/code/app/Modules/Transfer/Transfer.php
- Raw: https://pluginprobe.com/plugins/fluentform/5.2.9/raw/app/Modules/Transfer/Transfer.php
- Modified: 2025-01-06T06:28:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluentform/5.2.9/code/app/Modules/Transfer/Transfer.php#L10-L20`.

```php
<?php
namespace FluentForm\App\Modules\Transfer;

use Exception;
use FluentForm\App\Services\Transfer\TransferService;
use FluentForm\Framework\Foundation\App;

class Transfer
{

    /**
     * Request object
     *
     * @var \FluentForm\Framework\Request\Request $request
     */
    protected $request = null;


    public function __construct()
    {
        $this->request = App::getInstance()->make('request');
    }


    /**
     * Export forms as JSON.
     */
    public function exportForms()
    {
        try {
            $formIds = $this->request->get('forms');
            TransferService::exportForms($formIds);
        } catch (Exception $exception) {
            wp_send_json([
                'message' => $exception->getMessage()
            ], 424);
        }
    }

    /**
     * Import forms from a previously exported JSON file.
     */
    public function importForms()
    {
        try {
            $file = $this->request->file('file');
            wp_send_json(TransferService::importForms($file), 200);
        } catch (Exception $exception) {
            wp_send_json([
                'message' => $exception->getMessage()
            ], 424);
        }
    }

    public function exportEntries() {
        try {
            TransferService::exportEntries($this->request->get());
        } catch (Exception $exception) {
            wp_send_json([
                'message' => $exception->getMessage()
            ], 424);
        }
    }

}
```
