From db9b6d8d0d9f943fe321ea690701662dac828e94 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 20:00:01 +0100 Subject: Update fixtures --- .../DataFixtures/AnnotationFixtures.php | 50 ++++++++++++++++++++++ .../DataFixtures/ORM/LoadAnnotationData.php | 45 ------------------- 2 files changed, 50 insertions(+), 45 deletions(-) create mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php delete mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php (limited to 'src/Wallabag/AnnotationBundle/DataFixtures') 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 @@ +getReference('admin-user')); + $annotation1->setEntry($this->getReference('entry1')); + $annotation1->setText('This is my annotation /o/'); + $annotation1->setQuote('content'); + + $manager->persist($annotation1); + + $this->addReference('annotation1', $annotation1); + + $annotation2 = new Annotation($this->getReference('admin-user')); + $annotation2->setEntry($this->getReference('entry2')); + $annotation2->setText('This is my 2nd annotation /o/'); + $annotation2->setQuote('content'); + + $manager->persist($annotation2); + + $this->addReference('annotation2', $annotation2); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + EntryFixtures::class, + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php b/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php deleted file mode 100644 index 20e07fa3..00000000 --- a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php +++ /dev/null @@ -1,45 +0,0 @@ -getReference('admin-user')); - $annotation1->setEntry($this->getReference('entry1')); - $annotation1->setText('This is my annotation /o/'); - $annotation1->setQuote('content'); - - $manager->persist($annotation1); - - $this->addReference('annotation1', $annotation1); - - $annotation2 = new Annotation($this->getReference('admin-user')); - $annotation2->setEntry($this->getReference('entry2')); - $annotation2->setText('This is my 2nd annotation /o/'); - $annotation2->setQuote('content'); - - $manager->persist($annotation2); - - $this->addReference('annotation2', $annotation2); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 35; - } -} -- cgit v1.2.3