diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-02-26 18:17:37 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-02-26 18:17:37 +0100 |
commit | 162954763e6f68e0cf4002822007683bde62fc25 (patch) | |
tree | a85f850eddb30b3435d1bb5f45d16d9ab465bbf9 /src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php | |
parent | d3f1a9dc1ac181033ec54f9149d2807199fa8f17 (diff) | |
parent | b07c7dfe787313b75e0996265e13cccc78da41be (diff) | |
download | wallabag-162954763e6f68e0cf4002822007683bde62fc25.tar.gz wallabag-162954763e6f68e0cf4002822007683bde62fc25.tar.zst wallabag-162954763e6f68e0cf4002822007683bde62fc25.zip |
Merge pull request #1653 from wallabag/v2-annotator-comments
V2 annotator comments
Diffstat (limited to 'src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php')
-rw-r--r-- | src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php b/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php new file mode 100644 index 00000000..20e07fa3 --- /dev/null +++ b/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php | |||
@@ -0,0 +1,45 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\AnnotationBundle\DataFixtures\ORM; | ||
4 | |||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | ||
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\AnnotationBundle\Entity\Annotation; | ||
9 | |||
10 | class LoadAnnotationData extends AbstractFixture implements OrderedFixtureInterface | ||
11 | { | ||
12 | /** | ||
13 | * {@inheritdoc} | ||
14 | */ | ||
15 | public function load(ObjectManager $manager) | ||
16 | { | ||
17 | $annotation1 = new Annotation($this->getReference('admin-user')); | ||
18 | $annotation1->setEntry($this->getReference('entry1')); | ||
19 | $annotation1->setText('This is my annotation /o/'); | ||
20 | $annotation1->setQuote('content'); | ||
21 | |||
22 | $manager->persist($annotation1); | ||
23 | |||
24 | $this->addReference('annotation1', $annotation1); | ||
25 | |||
26 | $annotation2 = new Annotation($this->getReference('admin-user')); | ||
27 | $annotation2->setEntry($this->getReference('entry2')); | ||
28 | $annotation2->setText('This is my 2nd annotation /o/'); | ||
29 | $annotation2->setQuote('content'); | ||
30 | |||
31 | $manager->persist($annotation2); | ||
32 | |||
33 | $this->addReference('annotation2', $annotation2); | ||
34 | |||
35 | $manager->flush(); | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * {@inheritdoc} | ||
40 | */ | ||
41 | public function getOrder() | ||
42 | { | ||
43 | return 35; | ||
44 | } | ||
45 | } | ||