PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / FormMigration / Contracts / FormMigrationStep.php

FormMigrationStep.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/FormMigration/Contracts/FormMigrationStep.php

41 lines 1008 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\FormMigration\Contracts;
4
5 use Give\DonationForms\Models\DonationForm as DonationFormV3;
6 use Give\DonationForms\V2\Models\DonationForm as DonationFormV2;
7 use Give\FormMigration\DataTransferObjects\FormMigrationPayload;
8 use Give\FormMigration\FormMetaDecorator;
9 use Give\Framework\Blocks\BlockCollection;
10
11 abstract class FormMigrationStep
12 {
13 /** @var FormMetaDecorator */
14 public $formV2;
15
16 /** @var DonationFormV3 */
17 public $formV3;
18
19 /** @var BlockCollection */
20 protected $fieldBlocks;
21
22 public function __construct(FormMigrationPayload $payload)
23 {
24 $this->formV2 = new FormMetaDecorator($payload->formV2);
25 $this->formV3 = $payload->formV3;
26 $this->fieldBlocks = $payload->formV3->blocks;
27 }
28
29 public function canHandle(): bool
30 {
31 return true;
32 }
33
34 abstract public function process();
35
36 protected function getMetaV2($key)
37 {
38 return give()->form_meta->get_meta($this->formV2->id, $key, true);
39 }
40 }
41