PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.16.0
GiveWP – Donation Plugin and Fundraising Platform v2.16.0
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 / TestData / Addons / Funds / FundFactory.php
FundFactory.php
37 lines 810 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\TestData\Addons\Funds;
4
5 use Give\TestData\Framework\Factory;
6
7 /**
8 * Class FundFactory
9 * @package Give\TestData\Funds
10 */
11 class FundFactory extends Factory {
12
13 /**
14 * @return int
15 */
16 public function getRandomFund() {
17 global $wpdb;
18 $fundIds = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}give_funds" );
19
20 return $this->faker->randomElement( $fundIds );
21 }
22
23 /**
24 * @return array
25 */
26 public function definition() {
27 return [
28 'title' => $this->faker->catchPhrase(),
29 'description' => $this->faker->sentence( 6, true ),
30 'is_default' => 0,
31 'author_id' => $this->randomAuthor(),
32 'date_created' => $this->faker->dateTimeThisYear()->format( 'Y-m-d H:i:s' ),
33 'date_modified' => $this->faker->dateTimeThisYear()->format( 'Y-m-d H:i:s' ),
34 ];
35 }
36 }
37