commit 9f15cef3f61b6fe60ab9c1d2ca959cbfcb0e3765
parent 9762f9f74344134ea7ddd74fc26eeacae5a0a747
Author: Felicitus <felicitus@felicitus.org>
Date: Mon, 22 Jun 2015 20:22:45 +0200
Use BaseEntity for SiPrefixes, removed obsolete code
Diffstat:
2 files changed, 5 insertions(+), 45 deletions(-)
diff --git a/src/PartKeepr/SiPrefixBundle/Controller/DefaultController.php b/src/PartKeepr/SiPrefixBundle/Controller/DefaultController.php
@@ -1,31 +0,0 @@
-<?php
-
-namespace PartKeepr\SiPrefixBundle\Controller;
-
-use FOS\RestBundle\Request\ParamFetcher;
-use PartKeepr\DoctrineReflectionBundle\Controller\DoctrineRESTQueryController;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration as Routing;
-use JMS\Serializer\Annotation as JMS;
-use Nelmio\ApiDocBundle\Annotation\ApiDoc;
-use FOS\RestBundle\Controller\Annotations\View;
-
-class DefaultController extends DoctrineRESTQueryController
-{
- protected $targetEntity = "PartKeepr\\SiPrefixBundle\\Entity\\SiPrefix";
-
- /**
- * Retrieves SI Prefixes in the database
- *
- * @Routing\Route("/siprefix", defaults={"method" = "get","_format" = "json"})
- * @Routing\Method({"GET"})
- * @ApiDoc(section="siprefix",output="array<PartKeepr\SiPrefixBundle\Entity\SiPrefix>")
- *
- * @View()
- *
- * {@inheritdoc}
- */
- public function listAction(ParamFetcher $paramFetcher)
- {
- return parent::listAction($paramFetcher);
- }
-}-
\ No newline at end of file
diff --git a/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php b/src/PartKeepr/SiPrefixBundle/Entity/SiPrefix.php
@@ -1,11 +1,11 @@
<?php
namespace PartKeepr\SiPrefixBundle\Entity;
-use PartKeepr\Util\BaseEntity,
- Doctrine\ORM\Mapping as ORM,
- Symfony\Component\Validator\Constraints as Assert,
- PartKeepr\DoctrineReflectionBundle\Annotation\TargetService;
+use Doctrine\ORM\Mapping as ORM;
+use PartKeepr\DoctrineReflectionBundle\Annotation\TargetService;
+use PartKeepr\Util\BaseEntity;
use Symfony\Component\Serializer\Annotation\Groups;
+use Symfony\Component\Validator\Constraints as Assert;
/**
* Represents an SI Prefix
@@ -15,17 +15,9 @@ use Symfony\Component\Serializer\Annotation\Groups;
* @ORM\Entity
* @TargetService(uri="/api/si_prefixes")
*/
-class SiPrefix
+class SiPrefix extends BaseEntity
{
/**
- * @ORM\Id @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- * @var integer
- * @Groups({"default"})
- */
- public $id;
-
- /**
* The prefix name of the Si-Prefix (e.g. yotta, deca, deci, centi)
*
* @ORM\Column(type="string")