GetMigratedFormId.php
2 years ago
MapSettingsToDesignHeader.php
2 years ago
MapSettingsToDonationSummary.php
2 years ago
TransferDonations.php
8 months ago
TransferFormUrl.php
2 years ago
MapSettingsToDesignHeader.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\FormMigration\Actions; |
| 4 | |
| 5 | use Give\DonationForms\Models\DonationForm; |
| 6 | use Give\FormMigration\DataTransferObjects\DesignHeaderSettings; |
| 7 | use Give\FormMigration\DataTransferObjects\DonationSummarySettings; |
| 8 | use Give\Framework\Blocks\BlockCollection; |
| 9 | |
| 10 | class MapSettingsToDesignHeader |
| 11 | { |
| 12 | /** |
| 13 | * @var DonationForm |
| 14 | */ |
| 15 | protected $form; |
| 16 | |
| 17 | public function __construct(DonationForm $form) |
| 18 | { |
| 19 | $this->form = $form; |
| 20 | } |
| 21 | |
| 22 | public static function make(DonationForm $form): self |
| 23 | { |
| 24 | return new self($form); |
| 25 | } |
| 26 | |
| 27 | public function __invoke(DesignHeaderSettings $settings) |
| 28 | { |
| 29 | $this->form->settings->showHeader = $settings->isEnabled(); |
| 30 | |
| 31 | $this->form->settings->showHeading = $settings->hasHeading(); |
| 32 | $this->form->settings->heading = $settings->getHeading(); |
| 33 | |
| 34 | $this->form->settings->showDescription = $settings->hasDescription(); |
| 35 | $this->form->settings->description = $settings->getDescription(); |
| 36 | } |
| 37 | } |
| 38 |