From bbf1a10fc10118a437484a23469cc394cb2a43f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=BCbner?= Date: Fri, 10 Mar 2017 23:19:53 +0100 Subject: [PATCH] Update LDraw entities --- src/AppBundle/Entity/LDraw/Category.php | 115 +++++++++++ src/AppBundle/Entity/LDraw/Keyword.php | 114 +++++++++++ src/AppBundle/Entity/LDraw/Model.php | 134 +++++++++++++ src/AppBundle/Entity/LDraw/Part.php | 254 ++++++++++++++++++++++++ src/AppBundle/Entity/LDraw/Type.php | 105 ++++++++++ src/AppBundle/Entity/Model.php | 222 --------------------- 6 files changed, 722 insertions(+), 222 deletions(-) create mode 100644 src/AppBundle/Entity/LDraw/Category.php create mode 100644 src/AppBundle/Entity/LDraw/Keyword.php create mode 100644 src/AppBundle/Entity/LDraw/Model.php create mode 100644 src/AppBundle/Entity/LDraw/Part.php create mode 100644 src/AppBundle/Entity/LDraw/Type.php delete mode 100644 src/AppBundle/Entity/Model.php diff --git a/src/AppBundle/Entity/LDraw/Category.php b/src/AppBundle/Entity/LDraw/Category.php new file mode 100644 index 0000000..905488b --- /dev/null +++ b/src/AppBundle/Entity/LDraw/Category.php @@ -0,0 +1,115 @@ +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 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/LDraw/Keyword.php b/src/AppBundle/Entity/LDraw/Keyword.php new file mode 100644 index 0000000..19f7012 --- /dev/null +++ b/src/AppBundle/Entity/LDraw/Keyword.php @@ -0,0 +1,114 @@ +parts = 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; + } + + /** + * Get models. + * + * @return ArrayCollection + */ + public function getParts() + { + return $this->parts; + } + + /** + * @param Part $part + * + * @return Keyword + */ + public function addPart(Part $part) + { + $this->parts->add($part); + + return $this; + } + + /** + * @param Part $part + * + * @return Keyword + */ + public function removeModel(Part $part) + { + $this->parts->removeElement($part); + + return $this; + } +} diff --git a/src/AppBundle/Entity/LDraw/Model.php b/src/AppBundle/Entity/LDraw/Model.php new file mode 100644 index 0000000..6ec4064 --- /dev/null +++ b/src/AppBundle/Entity/LDraw/Model.php @@ -0,0 +1,134 @@ +id = $id; + } + + /** + * Get id. + * + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getFile() + { + return $this->file; + } + + /** + * @param string $file + * + * @return Model + */ + public function setFile($file) + { + $this->file = $file; + + return $this; + } + + /** + * 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; + } + + /** + * @return \DateTime + */ + public function getModified() + { + return $this->modified; + } + + /** + * @param \DateTime $modified + * + * @return Model + */ + public function setModified($modified) + { + $this->modified = $modified; + + return $this; + } +} diff --git a/src/AppBundle/Entity/LDraw/Part.php b/src/AppBundle/Entity/LDraw/Part.php new file mode 100644 index 0000000..d1a8bf6 --- /dev/null +++ b/src/AppBundle/Entity/LDraw/Part.php @@ -0,0 +1,254 @@ +keywords = new ArrayCollection(); + } + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @param string $id + * + * @return Part + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return Category + */ + public function getCategory() + { + return $this->category; + } + + /** + * @param Collection $category + * + * @return Part + */ + public function setCategory(Category $category) + { + $this->category = $category; + + return $this; + } + + /** + * @return Part + */ + public function getPrintOf() + { + return $this->printOf; + } + + /** + * @param Part $printOf + * + * @return Part + */ + public function setPrintOf($printOf) + { + $this->printOf = $printOf; + + return $this; + } + + /** + * @return Part + */ + public function getAliasOf() + { + return $this->aliasOf; + } + + /** + * @param Part $printOf + * + * @return Part + */ + public function setAliasOf($aliasOf) + { + $this->aliasOf = $aliasOf; + + return $this; + } + + /** + * @return Model + */ + public function getModel() + { + if (!$this->model) { + if ($this->printOf) { + return $this->printOf->getModel(); + } elseif ($this->aliasOf) { + return $this->aliasOf->getModel(); + } + } + + return $this->model; + } + + /** + * @param Model $model + * + * @return Part + */ + public function setModel($model) + { + $this->model = $model; + + return $this; + } + + /** + * Get keywords. + * + * @return Collection + */ + public function getKeywords() + { + return $this->keywords; + } + + /** + * @param Keyword $keyword + * + * @return Part + */ + public function addKeyword(Keyword $keyword) + { + if (!$this->keywords->contains($keyword)) { + $this->keywords->add($keyword); + $keyword->addPart($this); + } + + return $this; + } + + /** + * @param Keyword $keyword + * + * @return Part + */ + public function removePart(Keyword $keyword) + { + $this->keywords->removeElement($keyword); + + return $this; + } +} diff --git a/src/AppBundle/Entity/LDraw/Type.php b/src/AppBundle/Entity/LDraw/Type.php new file mode 100644 index 0000000..9fede63 --- /dev/null +++ b/src/AppBundle/Entity/LDraw/Type.php @@ -0,0 +1,105 @@ +parts = new ArrayCollection(); + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Get parts. + * + * @return ArrayCollection + */ + public function getParts() + { + return $this->parts; + } + + /** + * @param Part $part + * + * @return Type + */ + public function addPart(Part $part) + { + $this->parts->add($part); + + return $this; + } + + /** + * @param Part $part + * + * @return Type + */ + public function removePart(Part $part) + { + $this->parts->remove($part); + + return $this; + } +} diff --git a/src/AppBundle/Entity/Model.php b/src/AppBundle/Entity/Model.php deleted file mode 100644 index b88c5d6..0000000 --- a/src/AppBundle/Entity/Model.php +++ /dev/null @@ -1,222 +0,0 @@ -id; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * 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; - } -}