1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00
date-poll-api/src/DataFixtures/AppPollFixtures.php
2019-11-05 16:31:27 +01:00

23 lines
513 B
PHP

<?php
namespace App\DataFixtures;
use App\Entity\Poll;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class AppPollFixtures extends Fixture {
public function load( ObjectManager $manager ) {
// $product = new Product();
$poll = new Poll();
$poll->setTitle( 'démo sondage de texte' );
$poll->setCreationDate( new \DateTime() );
$poll->setExpiracyDate( new \DateTime( ( time() + 3600 * 24 ) ) );
$manager->persist( $poll );
$manager->flush();
}
}