diff --git a/src/AppBundle/Entity/BuildingKit.php b/src/AppBundle/Entity/BuildingKit.php new file mode 100644 index 0000000..2eed090 --- /dev/null +++ b/src/AppBundle/Entity/BuildingKit.php @@ -0,0 +1,244 @@ +parts = new ArrayCollection(); + $this->keywords = new ArrayCollection(); + } + + + /** + * Get id + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getNumber() + { + return $this->number; + } + + /** + * @param string $number + * + * @return BuildingKit + */ + public function setNumber($number) + { + $this->number = $number; + + return $this; + } + + + /** + * Set name + * + * @param string $name + * + * @return BuildingKit + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set year + * + * @param integer $year + * + * @return BuildingKit + */ + public function setYear($year) + { + $this->year = $year; + + return $this; + } + + /** + * Get year + * + * @return int + */ + public function getYear() + { + return $this->year; + } + + /** + * @return int + */ + public function getPartCount() + { + return $this->partCount; + } + + /** + * @param int $partCount + * + * @return BuildingKit + */ + public function setPartCount($partCount) + { + $this->partCount = $partCount; + + return $this; + } + + /** + * Get parts + * + * @return Collection + */ + public function getParts() + { + return $this->parts; + } + + /** + * @param Part_BuildingKit $part + * + * @return BuildingKit + */ + public function addPart(Part_BuildingKit $part) + { + $this->parts->add($part); + + return $this; + } + + /** + * @param Part_BuildingKit $part + * + * @return BuildingKit + */ + public function removePart(Part_BuildingKit $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/Category.php b/src/AppBundle/Entity/Category.php new file mode 100644 index 0000000..636ed55 --- /dev/null +++ b/src/AppBundle/Entity/Category.php @@ -0,0 +1,159 @@ +models = new ArrayCollection(); + $this->parts = new ArrayCollection(); + } + + + /** + * Get id + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * Set name + * + * @param string $name + * + * @return Category + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + 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 + * + * @return ArrayCollection + */ + public function getParts() + { + return $this->parts; + } + + /** + * @param Part $part + * + * @return Category + */ + public function addPart(Part $part) + { + $this->parts->add($part); + + return $this; + } + + /** + * @param Part $part + * + * @return Category + */ + public function removePart(Part $part) + { + $this->parts->remove($part); + + return $this; + } +} diff --git a/src/AppBundle/Entity/Color.php b/src/AppBundle/Entity/Color.php new file mode 100644 index 0000000..18d41c8 --- /dev/null +++ b/src/AppBundle/Entity/Color.php @@ -0,0 +1,158 @@ +id = $id; + + return $this; + } + + /** + * Get id + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * Set name + * + * @param string $name + * + * @return Color + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set rgb + * + * @param string $rgb + * + * @return Color + */ + public function setRgb($rgb) + { + $this->rgb = $rgb; + + return $this; + } + + /** + * Get rgb + * + * @return string + */ + public function getRgb() + { + return $this->rgb; + } + + /** + * @return Collection + */ + public function getPartBuildingKits() + { + return $this->part_building_kits; + } + + /** + * + * @param Part_BuildingKit $part_building_kit + * + * @return Color + */ + public function addPartBuildingKit(Part_BuildingKit $part_building_kit) + { + $this->part_building_kits->add($part_building_kit); + + return $this; + } + + /** + * @param Part_BuildingKit $part_building_kit + * + * @return Color + */ + public function removePartBuildingKit(Part_BuildingKit $part_building_kit) + { + $this->part_building_kits->remove($part_building_kit); + + return $this; + } + + /** + * Constructor + */ + public function __construct() + { + $this->part_building_kits = new \Doctrine\Common\Collections\ArrayCollection(); + } + +} diff --git a/src/AppBundle/Entity/Keyword.php b/src/AppBundle/Entity/Keyword.php new file mode 100644 index 0000000..7b40e3e --- /dev/null +++ b/src/AppBundle/Entity/Keyword.php @@ -0,0 +1,114 @@ +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/Model.php b/src/AppBundle/Entity/Model.php new file mode 100644 index 0000000..87e5cc0 --- /dev/null +++ b/src/AppBundle/Entity/Model.php @@ -0,0 +1,201 @@ +id; + } + + /** + * Set number + * + * @param string $number + * + * @return Model + */ + public function setNumber($number) + { + $this->number = $number; + + return $this; + } + + /** + * Get number + * + * @return string + */ + public function getNumber() + { + return $this->number; + } + + /** + * Set author + * + * @param string $author + * + * @return Model + */ + public function setAuthor($author) + { + $this->author = $author; + + return $this; + } + + /** + * Get author + * + * @return string + */ + public function getAuthor() + { + return $this->author; + } + + /** + * Set file + * + * @param string $file + * + * @return Model + */ + public function setFile($file) + { + $this->file = $file; + + return $this; + } + + /** + * Get file + * + * @return string + */ + public function getFile() + { + return $this->file; + } + + /** + * Get parts + * + * @return Collection + */ + public function getParts() + { + return $this->parts; + } + + /** + * @param Part $part + * + * @return Model + */ + public function addPart(Part $part) + { + $this->parts->add($part); + + return $this; + } + + /** + * @param Part $part + * + * @return Model + */ + public function removePart(Part $part) + { + $this->parts->remove($part); + + return $this; + } + + /** + * Set category + * + * @param Category $category + * + * @return Model + */ + public function setCategory(Category $category) + { + $category->addModel($this); + $this->category = $category; + + return $this; + } + + /** + * Get category + * + * @return Category + */ + public function getCategory() + { + return $this->category; + } +} diff --git a/src/AppBundle/Entity/Part.php b/src/AppBundle/Entity/Part.php new file mode 100644 index 0000000..feb3288 --- /dev/null +++ b/src/AppBundle/Entity/Part.php @@ -0,0 +1,198 @@ +building_kits = new ArrayCollection(); + } + + /** + * Get id. + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * Set number. + * + * @param string $number + * + * @return Part + */ + public function setNumber($number) + { + $this->number = $number; + + return $this; + } + + /** + * Get number. + * + * @return string + */ + public function getNumber() + { + return $this->number; + } + + /** + * Set name. + * + * @param string $name + * + * @return Part + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name. + * + * @return string + */ + public function getName() + { + 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() + { + return $this->building_kits; + } + + /** + * @param Part_BuildingKit $building_kit + * + * @return Part + */ + public function addBuildingKit(Part_BuildingKit $building_kit) + { + $this->building_kits->add($building_kit); + + return $this; + } + + /** + * @param Part_BuildingKit $building_kit + * + * @return Part + */ + public function removeBuildingKit($building_kit) + { + $this->building_kits->remove($building_kit); + + return $this; + } + + /** + * @return Category + */ + public function getCategory() + { + return $this->category; + } + + /** + * @param Collection $category + * + * @return Part + */ + public function setCategory(Category $category) + { + $this->category = $category; + + return $this; + } +} diff --git a/src/AppBundle/Entity/Part_BuildingKit.php b/src/AppBundle/Entity/Part_BuildingKit.php new file mode 100644 index 0000000..2133246 --- /dev/null +++ b/src/AppBundle/Entity/Part_BuildingKit.php @@ -0,0 +1,186 @@ +id; + } + + /** + * Set count + * + * @param integer $count + * + * @return Part_BuildingKit + */ + public function setCount($count) + { + $this->count = $count; + + return $this; + } + + /** + * Get count + * + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * Set color + * + * @param Color $color + * + * @return Part_BuildingKit + */ + public function setColor($color) + { + $this->color = $color; + + return $this; + } + + /** + * Get color + * + * @return Color + */ + public function getColor() + { + return $this->color; + } + + /** + * Set type + * + * @param boolean $type + * + * @return Part_BuildingKit + */ + public function setType($type) + { + $this->type = $type; + + return $this; + } + + /** + * Get type + * + * @return bool + */ + public function getType() + { + return $this->type; + } + + /** + * @return Part + */ + public function getPart() + { + return $this->part; + } + + /** + * @param Part $part + * + * @return Part_BuildingKit + */ + public function setPart(Part $part) + { + $part->addBuildingKit($this); + $this->part = $part; + + return $this; + } + + /** + * @return BuildingKit + */ + public function getBuildingKit() + { + return $this->building_kit; + } + + /** + * @param BuildingKit $building_kit + * + * @return Part_BuildingKit + */ + public function setBuildingKit(BuildingKit $building_kit) + { + $building_kit->addPart($this); + $this->building_kit = $building_kit; + + return $this; + } + + +} diff --git a/src/AppBundle/Repository/BuildingKitRepository.php b/src/AppBundle/Repository/BuildingKitRepository.php new file mode 100644 index 0000000..e5eaa81 --- /dev/null +++ b/src/AppBundle/Repository/BuildingKitRepository.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..adfdee4 --- /dev/null +++ b/src/AppBundle/Repository/CategoryRepository.php @@ -0,0 +1,15 @@ +