Source of file MockDatetimeField.php
Size: 0,539 Bytes - Last Modified: 2021-12-23T10:56:24+00:00
/var/www/docs.ssmods.com/process/src/code/fieldtypes/MockDatetimeField.php
12345678910111213141516171819202122232425262728 | <?php /** * Defines the methods that are injected into the {@link SS_Datetime} class for * generating mock data * * @package silverstripe-mock-data * @author Uncle Cheese <unclecheese@leftandmain.com> */ use Faker\Generator; class MockDatetimeField extends DataExtension { /** * Gets a random date and time from this year * * @param Faker\Generator * @return string */ public function getFakeData(Generator $faker) { return $faker->dateTimeThisYear()->format('Y-m-d H:i:s'); } } |