1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-15 19:42:08 +00:00

Add mandatory $class parameter

This commit is contained in:
Yassine Guedidi 2023-08-05 17:25:03 +01:00
parent c2bfc0f359
commit 667ea14d42
6 changed files with 28 additions and 20 deletions

View file

@ -7,7 +7,9 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
{
@ -16,8 +18,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
*/
public function load(ObjectManager $manager)
{
$annotation1 = new Annotation($this->getReference('admin-user'));
$annotation1->setEntry($this->getReference('entry1'));
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
$annotation1->setEntry($this->getReference('entry1', Entry::class));
$annotation1->setText('This is my annotation /o/');
$annotation1->setQuote('content');
@ -25,8 +27,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('annotation1', $annotation1);
$annotation2 = new Annotation($this->getReference('admin-user'));
$annotation2->setEntry($this->getReference('entry2'));
$annotation2 = new Annotation($this->getReference('admin-user', User::class));
$annotation2->setEntry($this->getReference('entry2', Entry::class));
$annotation2->setText('This is my 2nd annotation /o/');
$annotation2->setQuote('content');
@ -34,8 +36,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('annotation2', $annotation2);
$annotation3 = new Annotation($this->getReference('bob-user'));
$annotation3->setEntry($this->getReference('entry3'));
$annotation3 = new Annotation($this->getReference('bob-user', User::class));
$annotation3->setEntry($this->getReference('entry3', Entry::class));
$annotation3->setText('This is my first annotation !');
$annotation3->setQuote('content');