From 110965ec5a97099d8be700191ae358192c2abeb4 Mon Sep 17 00:00:00 2001 From: Alex Yao Date: Thu, 17 Mar 2016 11:25:46 +0800 Subject: [PATCH 1/2] Firmare database initial commit --- .../src/AppBundle/Entity/FirmwareConfig.php | 344 ++++++++++++++++++ .../Repository/FirmwareConfigRepository.php | 10 + 2 files changed, 354 insertions(+) create mode 100644 Symfony/src/AppBundle/Entity/FirmwareConfig.php create mode 100644 Symfony/src/AppBundle/Repository/FirmwareConfigRepository.php diff --git a/Symfony/src/AppBundle/Entity/FirmwareConfig.php b/Symfony/src/AppBundle/Entity/FirmwareConfig.php new file mode 100644 index 0000000..d2b0130 --- /dev/null +++ b/Symfony/src/AppBundle/Entity/FirmwareConfig.php @@ -0,0 +1,344 @@ +id; + } + + /** + * Set owner + * + * @param integer $owner + * + * @return FirmwareConfig + */ + public function setOwner($owner) + { + $this->owner = $owner; + + return $this; + } + + /** + * Get owner + * + * @return int + */ + public function getOwner() + { + return $this->owner; + } + + /** + * Set hexFileUrl + * + * @param string $hexFileUrl + * + * @return FirmwareConfig + */ + public function setHexFileUrl($hexFileUrl) + { + $this->hexFileUrl = $hexFileUrl; + + return $this; + } + + /** + * Get hexFileUrl + * + * @return string + */ + public function getHexFileUrl() + { + return $this->hexFileUrl; + } + + /** + * Set boardUploadConfig + * + * @param array $boardUploadConfig + * + * @return FirmwareConfig + */ + public function setBoardUploadConfig($boardUploadConfig) + { + $this->boardUploadConfig = $boardUploadConfig; + + return $this; + } + + /** + * Get boardUploadConfig + * + * @return array + */ + public function getBoardUploadConfig() + { + return $this->boardUploadConfig; + } + + /** + * Set iPProgrammer + * + * @param array $iPProgrammer + * + * @return FirmwareConfig + */ + public function setIPProgrammer($iPProgrammer) + { + $this->iPProgrammer = $iPProgrammer; + + return $this; + } + + /** + * Get iPProgrammer + * + * @return array + */ + public function getIPProgrammer() + { + return $this->iPProgrammer; + } + + /** + * Set serialPortAutoDetection + * + * @param boolean $serialPortAutoDetection + * + * @return FirmwareConfig + */ + public function setSerialPortAutoDetection($serialPortAutoDetection) + { + $this->serialPortAutoDetection = $serialPortAutoDetection; + + return $this; + } + + /** + * Get serialPortAutoDetection + * + * @return bool + */ + public function getSerialPortAutoDetection() + { + return $this->serialPortAutoDetection; + } + + /** + * Set buttonName + * + * @param string $buttonName + * + * @return FirmwareConfig + */ + public function setButtonName($buttonName) + { + $this->buttonName = $buttonName; + + return $this; + } + + /** + * Get buttonName + * + * @return string + */ + public function getButtonName() + { + return $this->buttonName; + } + + /** + * Set iFrameWidth + * + * @param integer $iFrameWidth + * + * @return FirmwareConfig + */ + public function setIFrameWidth($iFrameWidth) + { + $this->iFrameWidth = $iFrameWidth; + + return $this; + } + + /** + * Get iFrameWidth + * + * @return int + */ + public function getIFrameWidth() + { + return $this->iFrameWidth; + } + + /** + * Set iFrameHeight + * + * @param integer $iFrameHeight + * + * @return FirmwareConfig + */ + public function setIFrameHeight($iFrameHeight) + { + $this->iFrameHeight = $iFrameHeight; + + return $this; + } + + /** + * Get iFrameHeight + * + * @return int + */ + public function getIFrameHeight() + { + return $this->iFrameHeight; + } + + /** + * Set iFrameBackground + * + * @param string $iFrameBackground + * + * @return FirmwareConfig + */ + public function setIFrameBackground($iFrameBackground) + { + $this->iFrameBackground = $iFrameBackground; + + return $this; + } + + /** + * Get iFrameBackground + * + * @return string + */ + public function getIFrameBackground() + { + return $this->iFrameBackground; + } + + /** + * Set uniqueUrl + * + * @param string $uniqueUrl + * + * @return FirmwareConfig + */ + public function setUniqueUrl($uniqueUrl) + { + $this->uniqueUrl = $uniqueUrl; + + return $this; + } + + /** + * Get uniqueUrl + * + * @return string + */ + public function getUniqueUrl() + { + return $this->uniqueUrl; + } +} + diff --git a/Symfony/src/AppBundle/Repository/FirmwareConfigRepository.php b/Symfony/src/AppBundle/Repository/FirmwareConfigRepository.php new file mode 100644 index 0000000..401bf4b --- /dev/null +++ b/Symfony/src/AppBundle/Repository/FirmwareConfigRepository.php @@ -0,0 +1,10 @@ + Date: Thu, 31 Mar 2016 19:33:44 +0800 Subject: [PATCH 2/2] Supress phpmd + make long var short --- .../src/AppBundle/Entity/FirmwareConfig.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Symfony/src/AppBundle/Entity/FirmwareConfig.php b/Symfony/src/AppBundle/Entity/FirmwareConfig.php index d2b0130..8d33cff 100644 --- a/Symfony/src/AppBundle/Entity/FirmwareConfig.php +++ b/Symfony/src/AppBundle/Entity/FirmwareConfig.php @@ -8,6 +8,8 @@ * FirmwareConfig * * @ORM\Entity(repositoryClass="AppBundle\Repository\FirmwareConfigRepository") + * + * @SuppressWarnings(PHPMD) */ class FirmwareConfig { @@ -21,9 +23,8 @@ class FirmwareConfig private $id; /** - * @var int - * - * @ORM\Column(name="Owner", type="integer") + * @ORM\ManyToOne(targetEntity="User", inversedBy="firmwareConfigs") + * @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="CASCADE") */ private $owner; @@ -53,7 +54,7 @@ class FirmwareConfig * * @ORM\Column(name="SerialPortAutoDetection", type="boolean") */ - private $serialPortAutoDetection; + private $serialPortAutoDetect; /** * @var string @@ -198,27 +199,27 @@ public function getIPProgrammer() } /** - * Set serialPortAutoDetection + * Set serialPortAutoDetect * - * @param boolean $serialPortAutoDetection + * @param boolean $serialPortAutoDetect * * @return FirmwareConfig */ - public function setSerialPortAutoDetection($serialPortAutoDetection) + public function setSerialPortAutoDetect($serialPortAutoDetect) { - $this->serialPortAutoDetection = $serialPortAutoDetection; + $this->serialPortAutoDetect = $serialPortAutoDetect; return $this; } /** - * Get serialPortAutoDetection + * Get serialPortAutoDetect * * @return bool */ - public function getSerialPortAutoDetection() + public function isSerialPortAutoDetect() { - return $this->serialPortAutoDetection; + return $this->serialPortAutoDetect; } /** @@ -341,4 +342,3 @@ public function getUniqueUrl() return $this->uniqueUrl; } } -