diff --git a/src/AppBundle/Api/Client/Rebrickable/Entity/Part.php b/src/AppBundle/Api/Client/Rebrickable/Entity/Part.php index 103e624..b845c54 100644 --- a/src/AppBundle/Api/Client/Rebrickable/Entity/Part.php +++ b/src/AppBundle/Api/Client/Rebrickable/Entity/Part.php @@ -57,17 +57,17 @@ class Part /** * @return int */ - public function getPartNum() + public function getNumber() { - return $this->partNum; + return $this->number; } /** - * @param int $partNum + * @param int $number */ - public function setPartNum($partNum) + public function setNumber($number) { - $this->partNum = $partNum; + $this->number = $number; } /** diff --git a/src/AppBundle/Entity/Keyword.php b/src/AppBundle/Entity/Keyword.php deleted file mode 100644 index f35ebba..0000000 --- a/src/AppBundle/Entity/Keyword.php +++ /dev/null @@ -1,112 +0,0 @@ -building_kits = new ArrayCollection(); - } - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Set name. - * - * @param string $name - * - * @return Keyword - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * Get name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @return ArrayCollection - */ - public function getBuildingKits() - { - return $this->building_kits; - } - - /** - * @param BuildingKit $building_kit - * - * @return Keyword - */ - public function addBuildingKit(BuildingKit $building_kit) - { - $this->building_kits->add($building_kit); - - return $this; - } - - /** - * @param BuildingKit $building_kit - * - * @return Keyword - */ - public function removeBuildingKit(BuildingKit $building_kit) - { - $this->building_kits->remove($building_kit); - - return $this; - } -} diff --git a/src/AppBundle/Entity/Category.php b/src/AppBundle/Entity/Rebrickable/Category.php similarity index 64% rename from src/AppBundle/Entity/Category.php rename to src/AppBundle/Entity/Rebrickable/Category.php index 10be5c7..448f713 100644 --- a/src/AppBundle/Entity/Category.php +++ b/src/AppBundle/Entity/Rebrickable/Category.php @@ -1,6 +1,6 @@ models = new ArrayCollection(); $this->parts = new ArrayCollection(); } @@ -87,40 +79,6 @@ class Category return $this->name; } - /** - * Get models. - * - * @return ArrayCollection - */ - public function getModels() - { - return $this->models; - } - - /** - * @param Model $model - * - * @return Category - */ - public function addModel(Model $model) - { - $this->models->add($model); - - return $this; - } - - /** - * @param Model $model - * - * @return Category - */ - public function removeModel(Model $model) - { - $this->models->remove($model); - - return $this; - } - /** * Get parts. * diff --git a/src/AppBundle/Entity/Color.php b/src/AppBundle/Entity/Rebrickable/Color.php similarity index 63% rename from src/AppBundle/Entity/Color.php rename to src/AppBundle/Entity/Rebrickable/Color.php index abd6547..5055a1b 100644 --- a/src/AppBundle/Entity/Color.php +++ b/src/AppBundle/Entity/Rebrickable/Color.php @@ -1,7 +1,8 @@ part_sets = new ArrayCollection(); + } /** * Set id. @@ -114,43 +130,55 @@ class Color return $this->rgb; } + /** + * Is transparent. + * + * @return bool + */ + public function isTransparent() + { + return $this->transparent; + } + + /** + * Set transparent. + * + * @param bool $transparent + */ + public function setTransparent($transparent) + { + $this->transparent = $transparent; + } + /** * @return Collection */ public function getPartBuildingKits() { - return $this->part_building_kits; + return $this->part_sets; } /** - * @param Part_BuildingKit $part_building_kit + * @param Part_Set $part_building_kit * * @return Color */ - public function addPartBuildingKit(Part_BuildingKit $part_building_kit) + public function addPartBuildingKit(Part_Set $part_set) { - $this->part_building_kits->add($part_building_kit); + $this->part_sets->add($part_set); return $this; } /** - * @param Part_BuildingKit $part_building_kit + * @param Part_Set $part_building_kit * * @return Color */ - public function removePartBuildingKit(Part_BuildingKit $part_building_kit) + public function removePartBuildingKit(Part_Set $part_set) { - $this->part_building_kits->remove($part_building_kit); + $this->part_sets->remove($part_set); return $this; } - - /** - * Constructor. - */ - public function __construct() - { - $this->part_building_kits = new \Doctrine\Common\Collections\ArrayCollection(); - } } diff --git a/src/AppBundle/Entity/Part.php b/src/AppBundle/Entity/Rebrickable/Part.php similarity index 54% rename from src/AppBundle/Entity/Part.php rename to src/AppBundle/Entity/Rebrickable/Part.php index feb3288..61cae98 100644 --- a/src/AppBundle/Entity/Part.php +++ b/src/AppBundle/Entity/Rebrickable/Part.php @@ -1,6 +1,6 @@ building_kits = new ArrayCollection(); - } - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; + $this->sets = new ArrayCollection(); } /** @@ -124,54 +110,34 @@ class Part return $this->name; } - /** - * @return Model - */ - public function getModel() - { - return $this->model; - } - - /** - * @param Model $model - * - * @return Part - */ - public function setModel($model) - { - $this->model = $model; - - return $this; - } - /** * @return mixed */ - public function getBuildingKits() + public function getSets() { - return $this->building_kits; + return $this->sets; } /** - * @param Part_BuildingKit $building_kit + * @param Part_Set $set * * @return Part */ - public function addBuildingKit(Part_BuildingKit $building_kit) + public function addSet(Part_Set $set) { - $this->building_kits->add($building_kit); + $this->sets->add($set); return $this; } /** - * @param Part_BuildingKit $building_kit + * @param Part_Set $set * * @return Part */ - public function removeBuildingKit($building_kit) + public function removeSet($set) { - $this->building_kits->remove($building_kit); + $this->sets->removeElement($set); return $this; } diff --git a/src/AppBundle/Entity/Part_BuildingKit.php b/src/AppBundle/Entity/Rebrickable/Part_Set.php similarity index 66% rename from src/AppBundle/Entity/Part_BuildingKit.php rename to src/AppBundle/Entity/Rebrickable/Part_Set.php index 3703ef4..60c2233 100644 --- a/src/AppBundle/Entity/Part_BuildingKit.php +++ b/src/AppBundle/Entity/Rebrickable/Part_Set.php @@ -1,16 +1,16 @@ addBuildingKit($this); + $part->addSet($this); $this->part = $part; return $this; } /** - * @return BuildingKit + * @return Set */ - public function getBuildingKit() + public function getSet() { - return $this->building_kit; + return $this->set; } /** - * @param BuildingKit $building_kit + * @param Set $set * - * @return Part_BuildingKit + * @return Part_Set */ - public function setBuildingKit(BuildingKit $building_kit) + public function setSet(Set $set) { - $building_kit->addPart($this); - $this->building_kit = $building_kit; + $set->addPart($this); + $this->set = $set; return $this; } diff --git a/src/AppBundle/Entity/BuildingKit.php b/src/AppBundle/Entity/Rebrickable/Set.php similarity index 57% rename from src/AppBundle/Entity/BuildingKit.php rename to src/AppBundle/Entity/Rebrickable/Set.php index b6ee8ef..38b5939 100644 --- a/src/AppBundle/Entity/BuildingKit.php +++ b/src/AppBundle/Entity/Rebrickable/Set.php @@ -1,32 +1,33 @@ parts = new ArrayCollection(); - $this->keywords = new ArrayCollection(); + $this->themes = new ArrayCollection(); } - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } +// /** +// * Get id. +// * +// * @return int +// */ +// public function getId() +// { +// return $this->id; +// } /** * @return string @@ -95,7 +96,7 @@ class BuildingKit /** * @param string $number * - * @return BuildingKit + * @return Set */ public function setNumber($number) { @@ -109,7 +110,7 @@ class BuildingKit * * @param string $name * - * @return BuildingKit + * @return Set */ public function setName($name) { @@ -133,7 +134,7 @@ class BuildingKit * * @param int $year * - * @return BuildingKit + * @return Set */ public function setYear($year) { @@ -163,7 +164,7 @@ class BuildingKit /** * @param int $partCount * - * @return BuildingKit + * @return Set */ public function setPartCount($partCount) { @@ -183,11 +184,11 @@ class BuildingKit } /** - * @param Part_BuildingKit $part + * @param Part_Set $part * - * @return BuildingKit + * @return Set */ - public function addPart(Part_BuildingKit $part) + public function addPart(Part_Set $part) { $this->parts->add($part); @@ -195,48 +196,14 @@ class BuildingKit } /** - * @param Part_BuildingKit $part + * @param Part_Set $part * - * @return BuildingKit + * @return Set */ - public function removePart(Part_BuildingKit $part) + public function removePart(Part_Set $part) { $this->parts->remove($part); return $this; } - - /** - * Get keywords. - * - * @return Collection - */ - public function getKeywords() - { - return $this->keywords; - } - - /** - * @param Keyword $keyword - * - * @return BuildingKit - */ - public function addKeyword(Keyword $keyword) - { - $this->keywords->add($keyword); - - return $this; - } - - /** - * @param Keyword $keyword - * - * @return BuildingKit - */ - public function removeKeyword(Keyword $keyword) - { - $this->keywords->remove($keyword); - - return $this; - } } diff --git a/src/AppBundle/Entity/Rebrickable/Theme.php b/src/AppBundle/Entity/Rebrickable/Theme.php new file mode 100644 index 0000000..7a6c600 --- /dev/null +++ b/src/AppBundle/Entity/Rebrickable/Theme.php @@ -0,0 +1,125 @@ +id; + } + + /** + * @param int $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return Collection + */ + public function getParent() + { + return $this->parent; + } + + /** + * @param Collection $parent + */ + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * @return mixed + */ + public function getSets() + { + return $this->sets; + } + + /** + * @param Part_Set $set + * + * @return Theme + */ + public function addSet(Part_Set $set) + { + $this->sets->add($set); + + return $this; + } + + /** + * @param Part_Set $set + * + * @return Theme + */ + public function removeSet($set) + { + $this->sets->removeElement($set); + + return $this; + } +} diff --git a/src/AppBundle/Repository/BuildingKitRepository.php b/src/AppBundle/Repository/BuildingKitRepository.php deleted file mode 100644 index 5cf0efe..0000000 --- a/src/AppBundle/Repository/BuildingKitRepository.php +++ /dev/null @@ -1,26 +0,0 @@ -getEntityManager()->createQueryBuilder(); - - $qb->select('building_kit') - ->from('AppBundle:BuildingKit', 'building_kit') - ->innerJoin('building_kit.parts', 'parts') - ->where('parts.part = :id')->setParameter('id', $part->getId()); - - return $qb->getQuery()->getResult(); - } -} diff --git a/src/AppBundle/Repository/CategoryRepository.php b/src/AppBundle/Repository/CategoryRepository.php deleted file mode 100644 index 6b9fe2b..0000000 --- a/src/AppBundle/Repository/CategoryRepository.php +++ /dev/null @@ -1,13 +0,0 @@ -