1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-17 04:40:08 -07:00

Fix Inventory_Set entity

This commit is contained in:
David Hübner 2017-04-11 17:31:44 +02:00
parent 3135105d0b
commit c755f0f418
4 changed files with 30 additions and 3 deletions

View File

@ -38,9 +38,18 @@ class Inventory
*/ */
protected $inventoryParts; protected $inventoryParts;
/**
* @var Collection
*
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Inventory_Set", mappedBy="inventory")
*/
protected $inventorySets;
public function __construct() public function __construct()
{ {
$this->inventoryParts = new ArrayCollection(); $this->inventoryParts = new ArrayCollection();
$this->inventorySets = new ArrayCollection();
} }
/** /**
@ -90,4 +99,20 @@ class Inventory
{ {
$this->inventoryParts = $inventoryParts; $this->inventoryParts = $inventoryParts;
} }
/**
* @return Collection
*/
public function getInventorySets()
{
return $this->inventorySets;
}
/**
* @param Collection $inventorySets
*/
public function setInventorySets($inventorySets)
{
$this->inventorySets = $inventorySets;
}
} }

View File

@ -15,7 +15,7 @@ class Inventory_Set
/** /**
* @var Inventory * @var Inventory
* @ORM\Id * @ORM\Id
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Inventory", inversedBy="inventoryParts") * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Inventory", inversedBy="inventorySets")
*/ */
protected $inventory; protected $inventory;

View File

@ -60,6 +60,7 @@ class Set
public function __construct() public function __construct()
{ {
$this->inventories = new ArrayCollection(); $this->inventories = new ArrayCollection();
$this->inventorySets = new ArrayCollection();
} }
/** /**

View File

@ -45,8 +45,9 @@ class RebrickableLoaderService extends BaseLoaderService
private function truncateTables() private function truncateTables()
{ {
$query = $query ='
'TRUNCATE TABLE rebrickable_inventory_parts; TRUNCATE TABLE rebrickable_inventory_parts;
TRUNCATE TABLE rebrickable_inventory_sets;
TRUNCATE TABLE rebrickable_color; TRUNCATE TABLE rebrickable_color;
TRUNCATE TABLE rebrickable_inventory; TRUNCATE TABLE rebrickable_inventory;
TRUNCATE TABLE rebrickable_set; TRUNCATE TABLE rebrickable_set;