PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
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 / DonationForms / Properties / GoalSettings.php

GoalSettings.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/DonationForms/Properties/GoalSettings.php

29 lines 738 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\DonationForms\Properties;
4
5 use Give\DonationForms\ValueObjects\GoalType;
6
7 /**
8 * @since 4.5.0 Add default values to goal settings
9 * @since 4.3.0
10 */
11 class GoalSettings
12 {
13 public string $goalSource;
14 public float $goalAmount;
15 public GoalType $goalType;
16 public bool $enableDonationGoal;
17
18 public static function fromArray(array $data): GoalSettings
19 {
20 $settings = new self();
21 $settings->goalSource = $data['goalSource'] ?? '';
22 $settings->enableDonationGoal = $data['enableDonationGoal'] ?? false;
23 $settings->goalType = new GoalType($data['goalType'] ?? GoalType::AMOUNT);
24 $settings->goalAmount = $data['goalAmount'] ?? 0;
25
26 return $settings;
27 }
28 }
29