Skip to content

Commit

Permalink
Persist catalgou
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Jan 4, 2020
1 parent 195ba39 commit 4eb49ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions api/src/DataFixtures/AppFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,24 @@ public function load(ObjectManager $manager)
$vng->setName('Vereniging Nederlandse Gemeenten');
$vng->setSourceOrganization('0000');
$manager->persist($vng);
$manager->flush();
$manager->refresh($vng);

$denbosch= new Catalogue();
$denbosch->setName('Gemeente \'s-Hertogenbosch');
$denbosch->setSourceOrganization('001709124');
$manager->persist($denbosch);
$manager->flush();
$manager->refresh($denbosch);

$eindhoven = new Catalogue();
$eindhoven->setName('Gemeente Eindhoven');
$eindhoven->setSourceOrganization('001902763');
$manager->persist($eindhoven);
$manager->flush();
$manager->refresh($eindhoven);

$utrecht = new Catalogue();
$utrecht->setName('Gemeente Utrecht');
$utrecht->setSourceOrganization('002220647');
$manager->persist($utrecht);


$manager->flush();
$manager->refresh($utrecht);

// Dan wat productgroepen
$id = Uuid::fromString('5a6a1219-1e2d-4dc5-aa03-82ffe1ff6249');
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Product
* @var Catalogue The Catalogue that this product belongs to
*
* @MaxDepth(1)
* @ORM\ManyToOne(targetEntity="App\Entity\Catalogue", inversedBy="products")
* @ORM\ManyToOne(targetEntity="App\Entity\Catalogue", inversedBy="products",cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
* @Assert\NotNull
* @Groups({"read","write"})
Expand Down

0 comments on commit 4eb49ff

Please sign in to comment.