aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
commitdad1c546a521159ca65a5a7649651d37728f0e55 (patch)
treef1d59eb83b45adb83bb21726374133a399d3c740 /src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
parent5432f6150939af6e7d2e8bf0faea0576491aaed0 (diff)
parent6be9750155fa731d75898b4973a126a090345c2d (diff)
downloadwallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.gz
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.zst
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.zip
Merge pull request #1545 from wallabag/v2-user-tag
v2 – Remove user reference in tag
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
new file mode 100644
index 00000000..8553dced
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
@@ -0,0 +1,41 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Tag;
9
10class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $tag1 = new Tag();
18 $tag1->setLabel('foo');
19
20 $manager->persist($tag1);
21
22 $this->addReference('foo-tag', $tag1);
23
24 $tag2 = new Tag();
25 $tag2->setLabel('bar');
26
27 $manager->persist($tag2);
28
29 $this->addReference('bar-tag', $tag2);
30
31 $manager->flush();
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 public function getOrder()
38 {
39 return 25;
40 }
41}