# give/4.16.8.1/src/FormMigration/DataTransferObjects/TransferOptions.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.8.1. 36 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/src/FormMigration/DataTransferObjects/TransferOptions.php
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/src/FormMigration/DataTransferObjects/TransferOptions.php
- Modified: 2023-10-16T17:55:46+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/give/4.16.8.1/code/src/FormMigration/DataTransferObjects/TransferOptions.php#L10-L20`.

```php
<?php

namespace Give\FormMigration\DataTransferObjects;

use WP_REST_Request;

class TransferOptions
{
    /** @var bool */
    protected $delete;

    public function __construct(bool $delete)
    {
        $this->delete = $delete;
    }

    public static function fromRequest(WP_REST_Request $request): self
    {
        return new self(
            $request->get_param('delete')
        );
    }

    public static function fromArray($options): self
    {
        return new self(
            $options['delete']
        );
    }

    public function shouldDelete(): bool
    {
        return $this->delete;
    }
}

```
