PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.5
GiveWP – Donation Plugin and Fundraising Platform v4.15.5
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 2.31.0 2.31.1 All 253 releases
give / src / Campaigns / Factories / CampaignFactory.php
CampaignFactory.php
45 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Campaigns\Factories;
4
5 use Exception;
6 use Give\Campaigns\ValueObjects\CampaignGoalType;
7 use Give\Campaigns\ValueObjects\CampaignStatus;
8 use Give\Campaigns\ValueObjects\CampaignType;
9 use Give\DonationForms\Models\DonationForm;
10 use Give\Framework\Models\Factories\ModelFactory;
11 use Give\Framework\Support\Facades\DateTime\Temporal;
12
13 /**
14 * @since 4.0.0
15 */
16 class CampaignFactory extends ModelFactory
17 {
18 /**
19 * @inheritDoc
20 * @throws Exception
21 */
22 public function definition(): array
23 {
24 $currentDate = Temporal::getCurrentDateTime();
25 $createdAt = Temporal::withoutMicroseconds($currentDate);
26
27 return [
28 'type' => CampaignType::CORE(),
29 'title' => __('GiveWP Campaign', 'give'),
30 'shortDescription' => __('Campaign short description', 'give'),
31 'longDescription' => __('Campaign long description', 'give'),
32 'goal' => 5000,
33 'goalType' => CampaignGoalType::AMOUNT(),
34 'status' => CampaignStatus::ACTIVE(),
35 'logo' => '',
36 'image' => '',
37 'primaryColor' => '#28C77B',
38 'secondaryColor' => '#FFA200',
39 'createdAt' => $createdAt,
40 'startDate' => $createdAt,
41 'endDate' => null,
42 ];
43 }
44 }
45