commit 24c8c6c9b940babd9499b382949e14b584bf5c53
parent b3b4bc79dd6dfc279e7ccd63dcf1086c9ed33e82
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 3 Sep 2015 17:02:17 +0200
Added resources for part manufacturers and distributors
Diffstat:
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/app/config/config.yml b/app/config/config.yml
@@ -557,8 +557,29 @@ services:
- method: "initDenormalizationContext"
arguments:
- { groups: [ "default" ] }
-
-
+
+ resource.part_distributor:
+ parent: "api.resource"
+ arguments: [ "PartKeepr\\PartBundle\\Entity\\PartDistributor" ]
+ tags: [ { name: "api.resource" } ]
+ calls:
+ - method: "initNormalizationContext"
+ arguments: [ { groups: [ "default" ] } ]
+ - method: "initDenormalizationContext"
+ arguments:
+ - { groups: [ "default" ] }
+
+ resource.part_manufacturer:
+ parent: "api.resource"
+ arguments: [ "PartKeepr\\PartBundle\\Entity\\PartManufacturer" ]
+ tags: [ { name: "api.resource" } ]
+ calls:
+ - method: "initNormalizationContext"
+ arguments: [ { groups: [ "default" ] } ]
+ - method: "initDenormalizationContext"
+ arguments:
+ - { groups: [ "default" ] }
+
resource.manufacturer:
parent: "api.resource"
arguments: [ "PartKeepr\\ManufacturerBundle\Entity\Manufacturer" ]
diff --git a/src/PartKeepr/PartBundle/Entity/Part.php b/src/PartKeepr/PartBundle/Entity/Part.php
@@ -81,6 +81,7 @@ class Part extends BaseEntity
/**
* Holds the manufacturers which can manufacture this part
* @ORM\OneToMany(targetEntity="PartKeepr\PartBundle\Entity\PartManufacturer",mappedBy="part",cascade={"persist", "remove"})
+ * @Groups({"default"})
*
* @var ArrayCollection
*/
@@ -89,6 +90,7 @@ class Part extends BaseEntity
/**
* Holds the distributors from where we can buy the part
* @ORM\OneToMany(targetEntity="PartKeepr\PartBundle\Entity\PartDistributor",mappedBy="part",cascade={"persist", "remove"})
+ * @Groups({"default"})
*
* @var ArrayCollection
*/
@@ -97,6 +99,7 @@ class Part extends BaseEntity
/**
* Holds the part images
* @ORM\OneToMany(targetEntity="PartKeepr\PartBundle\Entity\PartImage",mappedBy="part",cascade={"persist", "remove"})
+ * @Groups({"default"})
*
* @var PartImage
*/