diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2018-11-29 16:41:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 16:41:23 +0100 |
commit | 39502b4748709948658fd236a1883b902c6fd470 (patch) | |
tree | dc7d2ecf643f9c28b75e4fdb5efc121dcafe3536 /src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php | |
parent | b878be4cc99fd4927c70b59386cf7a57b33bb381 (diff) | |
parent | 877787e5fe6a6545105616968939949b4db81347 (diff) | |
download | wallabag-39502b4748709948658fd236a1883b902c6fd470.tar.gz wallabag-39502b4748709948658fd236a1883b902c6fd470.tar.zst wallabag-39502b4748709948658fd236a1883b902c6fd470.zip |
Merge pull request #3758 from wallabag/dropping-php5
Dropping PHP < 7.1
Diffstat (limited to 'src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php')
-rw-r--r-- | src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php new file mode 100644 index 00000000..ed46cea9 --- /dev/null +++ b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php | |||
@@ -0,0 +1,50 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\AnnotationBundle\DataFixtures; | ||
4 | |||
5 | use Doctrine\Bundle\FixturesBundle\Fixture; | ||
6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\AnnotationBundle\Entity\Annotation; | ||
9 | use Wallabag\CoreBundle\DataFixtures\EntryFixtures; | ||
10 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
11 | |||
12 | class AnnotationFixtures extends Fixture implements DependentFixtureInterface | ||
13 | { | ||
14 | /** | ||
15 | * {@inheritdoc} | ||
16 | */ | ||
17 | public function load(ObjectManager $manager) | ||
18 | { | ||
19 | $annotation1 = new Annotation($this->getReference('admin-user')); | ||
20 | $annotation1->setEntry($this->getReference('entry1')); | ||
21 | $annotation1->setText('This is my annotation /o/'); | ||
22 | $annotation1->setQuote('content'); | ||
23 | |||
24 | $manager->persist($annotation1); | ||
25 | |||
26 | $this->addReference('annotation1', $annotation1); | ||
27 | |||
28 | $annotation2 = new Annotation($this->getReference('admin-user')); | ||
29 | $annotation2->setEntry($this->getReference('entry2')); | ||
30 | $annotation2->setText('This is my 2nd annotation /o/'); | ||
31 | $annotation2->setQuote('content'); | ||
32 | |||
33 | $manager->persist($annotation2); | ||
34 | |||
35 | $this->addReference('annotation2', $annotation2); | ||
36 | |||
37 | $manager->flush(); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * {@inheritdoc} | ||
42 | */ | ||
43 | public function getDependencies() | ||
44 | { | ||
45 | return [ | ||
46 | EntryFixtures::class, | ||
47 | UserFixtures::class, | ||
48 | ]; | ||
49 | } | ||
50 | } | ||