# give/4.18.0/src/FormMigration/Steps/DoubleTheDonation.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 42 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/FormMigration/Steps/DoubleTheDonation.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/FormMigration/Steps/DoubleTheDonation.php
- Modified: 2024-04-17T19:51:58+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.18.0/code/src/FormMigration/Steps/DoubleTheDonation.php#L10-L20`.

```php
<?php

namespace Give\FormMigration\Steps;

use Give\FormMigration\Contracts\FormMigrationStep;
use Give\Framework\Blocks\BlockModel;

/**
 * @since 3.8.0
 */
class DoubleTheDonation extends FormMigrationStep
{

    /**
     * @since 3.8.0
     */
    public function canHandle(): bool
    {
        return $this->formV2->getDoubleTheDonationStatus() === 'enabled';
    }

    /**
     * @since 3.8.0
     */
    public function process()
    {
        $block = BlockModel::make([
            'name'       => 'givewp/dtd',
            'attributes' => [
                'label'   => $this->formV2->getDoubleTheDonationLabel(),
                'company' => [
                    'company_id'   => '',
                    'company_name' => '',
                    'entered_text' => '',
                ],
            ],
        ]);

        $this->fieldBlocks->insertAfter('givewp/donation-amount', $block);
    }
}

```
