1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00
wallabag/fixtures/AnnotationFixtures.php
dependabot[bot] 67bd937619 Bump doctrine/data-fixtures from 1.8.1 to 2.0.2
Bumps [doctrine/data-fixtures](https://github.com/doctrine/data-fixtures) from 1.8.1 to 2.0.2.
- [Release notes](https://github.com/doctrine/data-fixtures/releases)
- [Upgrade guide](https://github.com/doctrine/data-fixtures/blob/2.0.x/UPGRADE.md)
- [Commits](https://github.com/doctrine/data-fixtures/compare/1.8.1...2.0.2)

---
updated-dependencies:
- dependency-name: doctrine/data-fixtures
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 23:46:13 +02:00

53 lines
1.7 KiB
PHP

<?php
namespace Wallabag\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\Entity\Annotation;
use Wallabag\Entity\Entry;
use Wallabag\Entity\User;
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
{
public function load(ObjectManager $manager): void
{
$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');
$manager->persist($annotation1);
$this->addReference('annotation1', $annotation1);
$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');
$manager->persist($annotation2);
$this->addReference('annotation2', $annotation2);
$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');
$manager->persist($annotation3);
$this->addReference('annotation3', $annotation3);
$manager->flush();
}
public function getDependencies(): array
{
return [
EntryFixtures::class,
UserFixtures::class,
];
}
}