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