mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-16 20:30:09 -07:00
Update Rebrickable entities
Update entities to match Rebrickable v3 table structure
This commit is contained in:
parent
faf50cacae
commit
6f33519ea9
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Category.
|
* Category.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="category")
|
* @ORM\Table(name="rebrickable_category")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Category
|
class Category
|
||||||
@ -21,21 +21,21 @@ class Category
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
*/
|
*/
|
||||||
private $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="string", length=255, unique=true)
|
* @ORM\Column(name="name", type="string", length=255, unique=true)
|
||||||
*/
|
*/
|
||||||
private $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Collection
|
||||||
*
|
*
|
||||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Part", mappedBy="category")
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Part", mappedBy="category")
|
||||||
*/
|
*/
|
||||||
private $parts;
|
protected $parts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BuildingKit constructor.
|
* BuildingKit constructor.
|
||||||
|
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Color.
|
* Color.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="color")
|
* @ORM\Table(name="rebrickable_color")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Color
|
class Color
|
||||||
@ -20,42 +20,42 @@ class Color
|
|||||||
* @ORM\Column(name="id", type="integer")
|
* @ORM\Column(name="id", type="integer")
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
*/
|
*/
|
||||||
private $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="string", length=255, unique=true)
|
* @ORM\Column(name="name", type="string", length=255, unique=true)
|
||||||
*/
|
*/
|
||||||
private $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="rgb", type="string", length=6, unique=false)
|
* @ORM\Column(name="rgb", type="string", length=6, unique=false)
|
||||||
*/
|
*/
|
||||||
private $rgb;
|
protected $rgb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="transparent", type="boolean")
|
* @ORM\Column(name="transparent", type="boolean")
|
||||||
*/
|
*/
|
||||||
private $transparent;
|
protected $transparent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Collection
|
||||||
*
|
*
|
||||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Part_Set", mappedBy="color")
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Inventory_part", mappedBy="color")
|
||||||
*/
|
*/
|
||||||
private $part_sets;
|
protected $inventoryParts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->part_sets = new ArrayCollection();
|
$this->inventoryParts = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,31 +153,31 @@ class Color
|
|||||||
/**
|
/**
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getPartBuildingKits()
|
public function getPartInventoryParts()
|
||||||
{
|
{
|
||||||
return $this->part_sets;
|
return $this->inventoryParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $part_building_kit
|
* @param Inventory_Part $part_building_kit
|
||||||
*
|
*
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function addPartBuildingKit(Part_Set $part_set)
|
public function addPartInventoryPart(Inventory_Part $inventoryPart)
|
||||||
{
|
{
|
||||||
$this->part_sets->add($part_set);
|
$this->inventoryParts->add($inventoryPart);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $part_building_kit
|
* @param Inventory_Part $part_building_kit
|
||||||
*
|
*
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function removePartBuildingKit(Part_Set $part_set)
|
public function removePartInventoryPart(Inventory_Part $inventoryPart)
|
||||||
{
|
{
|
||||||
$this->part_sets->remove($part_set);
|
$this->inventoryParts->remove($inventoryPart);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
116
src/AppBundle/Entity/Rebrickable/Inventory.php
Normal file
116
src/AppBundle/Entity/Rebrickable/Inventory.php
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace AppBundle\Entity\Rebrickable;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Part.
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="rebrickable_inventory")
|
||||||
|
* @ORM\Entity
|
||||||
|
*/
|
||||||
|
class Inventory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Inventory ID.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*/
|
||||||
|
protected $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @ORM\Column(type="integer")
|
||||||
|
*/
|
||||||
|
protected $version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Set
|
||||||
|
*
|
||||||
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Set", inversedBy="inventories")
|
||||||
|
*/
|
||||||
|
protected $set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Collection
|
||||||
|
*
|
||||||
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Inventory_Part", mappedBy="inventory")
|
||||||
|
*/
|
||||||
|
protected $inventoryParts;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->inventoryParts = new ArrayCollection();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $id
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getVersion()
|
||||||
|
{
|
||||||
|
return $this->version;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $version
|
||||||
|
*/
|
||||||
|
public function setVersion($version)
|
||||||
|
{
|
||||||
|
$this->version = $version;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Set
|
||||||
|
*/
|
||||||
|
public function getSet()
|
||||||
|
{
|
||||||
|
return $this->set;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Set $set
|
||||||
|
*/
|
||||||
|
public function setSet($set)
|
||||||
|
{
|
||||||
|
$this->set = $set;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection
|
||||||
|
*/
|
||||||
|
public function getInventoryParts()
|
||||||
|
{
|
||||||
|
return $this->inventoryParts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Inventory_Part $inventoryParts
|
||||||
|
*/
|
||||||
|
public function setInventoryParts($inventoryParts)
|
||||||
|
{
|
||||||
|
$this->inventoryParts = $inventoryParts;
|
||||||
|
}
|
||||||
|
}
|
@ -5,73 +5,54 @@ namespace AppBundle\Entity\Rebrickable;
|
|||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part_Set.
|
* Inventory_Part.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="part_set")
|
* @ORM\Table(name="rebrickable_inventory_parts")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Part_Set
|
class Inventory_Part
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="id", type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
*/
|
||||||
private $id;
|
protected $quantity;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="count", type="integer")
|
|
||||||
*/
|
|
||||||
private $count;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Color
|
* @var Color
|
||||||
*
|
* @ORM\Id
|
||||||
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Color", inversedBy="part_sets")
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Color", inversedBy="inventoryParts")
|
||||||
*/
|
*/
|
||||||
private $color;
|
protected $color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="type", type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
*/
|
*/
|
||||||
private $type;
|
protected $isSpare;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Part
|
* @var Part
|
||||||
*
|
* @ORM\Id
|
||||||
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Part", inversedBy="sets" )
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Part", inversedBy="inventoryParts")
|
||||||
*/
|
*/
|
||||||
private $part;
|
protected $part;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Set
|
* @var Inventory
|
||||||
*
|
* @ORM\Id
|
||||||
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Set", inversedBy="parts")
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Inventory", inversedBy="inventoryParts")
|
||||||
*/
|
*/
|
||||||
private $set;
|
protected $inventory;
|
||||||
|
|
||||||
/**
|
|
||||||
* Get id.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getId()
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set count.
|
* Set count.
|
||||||
*
|
*
|
||||||
* @param int $count
|
* @param int $count
|
||||||
*
|
*
|
||||||
* @return Part_Set
|
* @return Inventory_Part
|
||||||
*/
|
*/
|
||||||
public function setCount($count)
|
public function setCount($count)
|
||||||
{
|
{
|
||||||
@ -85,9 +66,9 @@ class Part_Set
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getCount()
|
public function getQuantity()
|
||||||
{
|
{
|
||||||
return $this->count;
|
return $this->quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -95,7 +76,7 @@ class Part_Set
|
|||||||
*
|
*
|
||||||
* @param Color $color
|
* @param Color $color
|
||||||
*
|
*
|
||||||
* @return Part_Set
|
* @return Inventory_Part
|
||||||
*/
|
*/
|
||||||
public function setColor($color)
|
public function setColor($color)
|
||||||
{
|
{
|
||||||
@ -119,11 +100,11 @@ class Part_Set
|
|||||||
*
|
*
|
||||||
* @param bool $type
|
* @param bool $type
|
||||||
*
|
*
|
||||||
* @return Part_Set
|
* @return Inventory_Part
|
||||||
*/
|
*/
|
||||||
public function setType($type)
|
public function setIsSpare($isSpare)
|
||||||
{
|
{
|
||||||
$this->type = $type;
|
$this->isSpare = $isSpare;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -133,9 +114,9 @@ class Part_Set
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function getType()
|
public function isSpare()
|
||||||
{
|
{
|
||||||
return $this->type;
|
return $this->isSpare();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,11 +130,10 @@ class Part_Set
|
|||||||
/**
|
/**
|
||||||
* @param Part $part
|
* @param Part $part
|
||||||
*
|
*
|
||||||
* @return Part_Set
|
* @return Inventory_Part
|
||||||
*/
|
*/
|
||||||
public function setPart(Part $part)
|
public function setPart(Part $part)
|
||||||
{
|
{
|
||||||
$part->addSet($this);
|
|
||||||
$this->part = $part;
|
$this->part = $part;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -162,20 +142,19 @@ class Part_Set
|
|||||||
/**
|
/**
|
||||||
* @return Set
|
* @return Set
|
||||||
*/
|
*/
|
||||||
public function getSet()
|
public function getInventory()
|
||||||
{
|
{
|
||||||
return $this->set;
|
return $this->inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Set $set
|
* @param Inventory $inventory
|
||||||
*
|
*
|
||||||
* @return Part_Set
|
* @return Inventory_Part
|
||||||
*/
|
*/
|
||||||
public function setSet(Set $set)
|
public function setInventory(Inventory $inventory)
|
||||||
{
|
{
|
||||||
$set->addPart($this);
|
$this->inventory = $inventory;
|
||||||
$this->set = $set;
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
@ -9,20 +9,11 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Part.
|
* Part.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="part")
|
* @ORM\Table(name="rebrickable_part")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Part
|
class Part
|
||||||
{
|
{
|
||||||
// /**
|
|
||||||
// * @var int
|
|
||||||
// *
|
|
||||||
// * @ORM\Column(name="id", type="integer")
|
|
||||||
// * @ORM\Id
|
|
||||||
// * @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
// */
|
|
||||||
// private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part ID number.
|
* Part ID number.
|
||||||
*
|
*
|
||||||
@ -31,35 +22,35 @@ class Part
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\Column(name="id", type="string", length=255, unique=true)
|
* @ORM\Column(name="id", type="string", length=255, unique=true)
|
||||||
*/
|
*/
|
||||||
private $number;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="string", length=255)
|
* @ORM\Column(name="name", type="string", length=255)
|
||||||
*/
|
*/
|
||||||
private $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Category
|
* @var Category
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Category", inversedBy="parts")
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Category", inversedBy="parts")
|
||||||
*/
|
*/
|
||||||
private $category;
|
protected $category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Collection
|
||||||
*
|
*
|
||||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Part_Set", mappedBy="part")
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Inventory_Part", mappedBy="part")
|
||||||
*/
|
*/
|
||||||
private $sets;
|
protected $inventoryParts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part constructor.
|
* Part constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->sets = new ArrayCollection();
|
$this->inventoryParts = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,9 +60,9 @@ class Part
|
|||||||
*
|
*
|
||||||
* @return Part
|
* @return Part
|
||||||
*/
|
*/
|
||||||
public function setNumber($number)
|
public function setId($id)
|
||||||
{
|
{
|
||||||
$this->number = $number;
|
$this->id = $id;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -81,9 +72,9 @@ class Part
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getNumber()
|
public function getId()
|
||||||
{
|
{
|
||||||
return $this->number;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,33 +102,33 @@ class Part
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getSets()
|
public function getInventoryParts()
|
||||||
{
|
{
|
||||||
return $this->sets;
|
return $this->inventoryParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $set
|
* @param Inventory_Part $invetoryPart
|
||||||
*
|
*
|
||||||
* @return Part
|
* @return Part
|
||||||
*/
|
*/
|
||||||
public function addSet(Part_Set $set)
|
public function addInventoryPart(Inventory_Part $inventoryPart)
|
||||||
{
|
{
|
||||||
$this->sets->add($set);
|
$this->inventoryParts->add($inventoryPart);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $set
|
* @param Inventory_Part $set
|
||||||
*
|
*
|
||||||
* @return Part
|
* @return Part
|
||||||
*/
|
*/
|
||||||
public function removeSet($set)
|
public function removeInventoryPart($inventoryPart)
|
||||||
{
|
{
|
||||||
$this->sets->removeElement($set);
|
$this->inventoryParts->removeElement($inventoryPart);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -9,82 +9,62 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Set.
|
* Set.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="set")
|
* @ORM\Table(name="rebrickable_set")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Set
|
class Set
|
||||||
{
|
{
|
||||||
// /**
|
|
||||||
// * @var int
|
|
||||||
// *
|
|
||||||
// * @ORM\Column(name="id", type="integer")
|
|
||||||
// * @ORM\Id
|
|
||||||
// * @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
// */
|
|
||||||
// private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\Column(name="id", type="string", length=255, unique=true)
|
* @ORM\Column(name="id", type="string", length=255, unique=true)
|
||||||
*/
|
*/
|
||||||
private $number;
|
protected $number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="string", length=255, nullable=true)
|
* @ORM\Column(name="name", type="string", length=255, nullable=true)
|
||||||
*/
|
*/
|
||||||
private $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="year", type="integer", nullable=true)
|
* @ORM\Column(name="year", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $year;
|
protected $year;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="part_count", type="integer", nullable=true)
|
* @ORM\Column(name="num_parts", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $partCount;
|
protected $partCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Collection
|
||||||
*
|
*
|
||||||
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Part_Set", mappedBy="set")
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Inventory", mappedBy="set")
|
||||||
*/
|
*/
|
||||||
private $parts;
|
protected $inventories;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Theme
|
||||||
*
|
*
|
||||||
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Rebrickable\Theme", mappedBy="sets")
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Rebrickable\Theme", inversedBy="sets")
|
||||||
*/
|
*/
|
||||||
private $themes;
|
protected $theme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set constructor.
|
* Set constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->parts = new ArrayCollection();
|
$this->inventories = new ArrayCollection();
|
||||||
$this->themes = new ArrayCollection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Get id.
|
|
||||||
// *
|
|
||||||
// * @return int
|
|
||||||
// */
|
|
||||||
// public function getId()
|
|
||||||
// {
|
|
||||||
// return $this->id;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@ -178,32 +158,48 @@ class Set
|
|||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function getParts()
|
public function getInventories()
|
||||||
{
|
{
|
||||||
return $this->parts;
|
return $this->inventories;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $part
|
* @param Inventory $inventory
|
||||||
*
|
*
|
||||||
* @return Set
|
* @return Set
|
||||||
*/
|
*/
|
||||||
public function addPart(Part_Set $part)
|
public function addInventory(Inventory $inventory)
|
||||||
{
|
{
|
||||||
$this->parts->add($part);
|
$this->inventories->add($inventory);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $part
|
* @param Inventory $part
|
||||||
*
|
*
|
||||||
* @return Set
|
* @return Set
|
||||||
*/
|
*/
|
||||||
public function removePart(Part_Set $part)
|
public function removeInventory(Inventory $inventory)
|
||||||
{
|
{
|
||||||
$this->parts->remove($part);
|
$this->inventories->removeElement($inventory);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Theme
|
||||||
|
*/
|
||||||
|
public function getTheme()
|
||||||
|
{
|
||||||
|
return $this->theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Theme $theme
|
||||||
|
*/
|
||||||
|
public function setTheme($theme)
|
||||||
|
{
|
||||||
|
$this->theme = $theme;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Theme.
|
* Theme.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="theme")
|
* @ORM\Table(name="rebrickable_theme")
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
*/
|
*/
|
||||||
class Theme
|
class Theme
|
||||||
@ -16,32 +16,32 @@ class Theme
|
|||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="id", type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
*/
|
*/
|
||||||
private $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="string", length=255)
|
* @ORM\Column(type="string", length=255)
|
||||||
*/
|
*/
|
||||||
private $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Theme
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(targetEntity="Theme")
|
* @ORM\ManyToOne(targetEntity="Theme")
|
||||||
* @ORM\JoinColumn(onDelete="SET NULL")
|
* @ORM\JoinColumn(onDelete="SET NULL")
|
||||||
*/
|
*/
|
||||||
private $parent;
|
protected $parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection
|
* @var Collection
|
||||||
*
|
*
|
||||||
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Rebrickable\Set", inversedBy="themes")
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Rebrickable\Set", mappedBy="theme")
|
||||||
*/
|
*/
|
||||||
private $sets;
|
protected $sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
@ -76,7 +76,7 @@ class Theme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection
|
* @return Theme
|
||||||
*/
|
*/
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
@ -100,11 +100,11 @@ class Theme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $set
|
* @param Set $set
|
||||||
*
|
*
|
||||||
* @return Theme
|
* @return Theme
|
||||||
*/
|
*/
|
||||||
public function addSet(Part_Set $set)
|
public function addSet(Set $set)
|
||||||
{
|
{
|
||||||
$this->sets->add($set);
|
$this->sets->add($set);
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class Theme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Part_Set $set
|
* @param Set $set
|
||||||
*
|
*
|
||||||
* @return Theme
|
* @return Theme
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user