]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
Add some fixtures
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadEntryData.php
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
new file mode 100644 (file)
index 0000000..fccd06b
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+namespace Wallabag\CoreBundle\DataFixtures\ORM;
+
+use Doctrine\Common\DataFixtures\AbstractFixture;
+use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
+use Doctrine\Common\Persistence\ObjectManager;
+use Wallabag\CoreBundle\Entity\Entry;
+
+class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
+{
+    /**
+     * {@inheritDoc}
+     */
+    public function load(ObjectManager $manager)
+    {
+        $entry1 = new Entry($this->getReference('admin-user'));
+        $entry1->setUrl('http://0.0.0.0');
+        $entry1->setTitle('test title');
+        $entry1->setContent('This is my content /o/');
+
+        $manager->persist($entry1);
+        $manager->flush();
+
+        $this->addReference('entry1', $entry1);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getOrder()
+    {
+        return 20;
+    }
+}