文件操作 - CampaignFactory.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Campaigns/Factories/CampaignFactory.php
编辑文件内容
<?php namespace Give\Campaigns\Factories; use Exception; use Give\Campaigns\ValueObjects\CampaignGoalType; use Give\Campaigns\ValueObjects\CampaignStatus; use Give\Campaigns\ValueObjects\CampaignType; use Give\DonationForms\Models\DonationForm; use Give\Framework\Models\Factories\ModelFactory; use Give\Framework\Support\Facades\DateTime\Temporal; /** * @since 4.0.0 */ class CampaignFactory extends ModelFactory { /** * @inheritDoc * @throws Exception */ public function definition(): array { $currentDate = Temporal::getCurrentDateTime(); $createdAt = Temporal::withoutMicroseconds($currentDate); return [ 'type' => CampaignType::CORE(), 'title' => __('GiveWP Campaign', 'give'), 'shortDescription' => __('Campaign short description', 'give'), 'longDescription' => __('Campaign long description', 'give'), 'goal' => 5000, 'goalType' => CampaignGoalType::AMOUNT(), 'status' => CampaignStatus::ACTIVE(), 'logo' => '', 'image' => '', 'primaryColor' => '#28C77B', 'secondaryColor' => '#FFA200', 'createdAt' => $createdAt, 'startDate' => $createdAt, 'endDate' => null, ]; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件