# give/4.16.9/src/TestData/Addons/Funds/FundFactory.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 40 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/TestData/Addons/Funds/FundFactory.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/TestData/Addons/Funds/FundFactory.php
- Modified: 2021-11-23T23:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/TestData/Addons/Funds/FundFactory.php#L10-L20`.

```php
<?php

namespace Give\TestData\Addons\Funds;

use Give\TestData\Framework\Factory;

/**
 * Class FundFactory
 * @package Give\TestData\Funds
 */
class FundFactory extends Factory
{

    /**
     * @return int
     */
    public function getRandomFund()
    {
        global $wpdb;
        $fundIds = $wpdb->get_col("SELECT id FROM {$wpdb->prefix}give_funds");

        return $this->faker->randomElement($fundIds);
    }

    /**
     * @return array
     */
    public function definition()
    {
        return [
            'title' => $this->faker->catchPhrase(),
            'description' => $this->faker->sentence(6, true),
            'is_default' => 0,
            'author_id' => $this->randomAuthor(),
            'date_created' => $this->faker->dateTimeThisYear()->format('Y-m-d H:i:s'),
            'date_modified' => $this->faker->dateTimeThisYear()->format('Y-m-d H:i:s'),
        ];
    }
}

```
