2015-12-29 13:50:52 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\DataFixtures;
|
2015-12-29 13:50:52 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
2020-06-15 06:25:59 +00:00
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Entity\Tag;
|
2015-12-29 13:50:52 +00:00
|
|
|
|
2018-11-26 19:00:01 +00:00
|
|
|
class TagFixtures extends Fixture
|
2015-12-29 13:50:52 +00:00
|
|
|
{
|
2020-06-15 06:25:59 +00:00
|
|
|
public function load(ObjectManager $manager): void
|
2015-12-29 13:50:52 +00:00
|
|
|
{
|
2018-12-29 18:22:05 +00:00
|
|
|
$tags = [
|
2024-01-01 18:11:01 +00:00
|
|
|
'foo-bar-tag' => 'foo bar', // tag used for EntryControllerTest
|
2018-12-29 18:22:05 +00:00
|
|
|
'bar-tag' => 'bar',
|
|
|
|
'baz-tag' => 'baz', // tag used for ExportControllerTest
|
|
|
|
'foo-tag' => 'foo',
|
|
|
|
'bob-tag' => 'bob', // tag used for TagRestControllerTest
|
|
|
|
];
|
|
|
|
|
|
|
|
foreach ($tags as $reference => $label) {
|
|
|
|
$tag = new Tag();
|
|
|
|
$tag->setLabel($label);
|
|
|
|
|
|
|
|
$manager->persist($tag);
|
|
|
|
|
|
|
|
$this->addReference($reference, $tag);
|
|
|
|
}
|
2017-08-03 10:46:20 +00:00
|
|
|
|
2015-12-29 13:50:52 +00:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
}
|