mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-15 19:42:08 +00:00
Update fixtures
This commit is contained in:
parent
9394e8098a
commit
db9b6d8d0d
9 changed files with 64 additions and 72 deletions
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\AnnotationBundle\DataFixtures\ORM;
|
||||
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
|
||||
class LoadAnnotationData extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$annotation1 = new Annotation($this->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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue