commit 936ea9d92b18b06d7c6be24f46543c2545b51f12
parent 24c8c6c9b940babd9499b382949e14b584bf5c53
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 3 Sep 2015 17:06:54 +0200
Serialize part distributor and part manufacturer properties
Diffstat:
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/PartKeepr/PartBundle/Entity/PartDistributor.php b/src/PartKeepr/PartBundle/Entity/PartDistributor.php
@@ -6,6 +6,7 @@ use PartKeepr\DistributorBundle\Entity\Distributor;
use PartKeepr\PartKeepr;
use PartKeepr\Util\BaseEntity;
use PartKeepr\Util\Exceptions\OutOfRangeException;
+use Symfony\Component\Serializer\Annotation\Groups;
/**
* This class represents the link between a part and a distributor.
@@ -22,12 +23,14 @@ class PartDistributor extends BaseEntity
/**
* @ORM\ManyToOne(targetEntity="PartKeepr\DistributorBundle\Entity\Distributor")
+ * @Groups({"default"})
*/
private $distributor;
/**
* The order number for the part and distributor
* @ORM\Column(type="string",nullable=true)
+ * @Groups({"default"})
*
* @var string
*/
@@ -38,6 +41,7 @@ class PartDistributor extends BaseEntity
* certain manufacturers.
*
* @ORM\Column(type="integer")
+ * @Groups({"default"})
* @var integer
*/
private $packagingUnit;
@@ -47,6 +51,7 @@ class PartDistributor extends BaseEntity
* needs to be per item, not per packaging unit.
*
* @ORM\Column(type="decimal",precision=13,scale=4,nullable=true)
+ * @Groups({"default"})
* @var float
*/
private $price;
@@ -54,7 +59,7 @@ class PartDistributor extends BaseEntity
/**
* The distributor's SKU (stock keeping unit) for the part. Used with barcodes.
* @ORM\Column(type="string",nullable=true)
- *
+ * @Groups({"default"})
* @var string
*/
private $sku;
diff --git a/src/PartKeepr/PartBundle/Entity/PartManufacturer.php b/src/PartKeepr/PartBundle/Entity/PartManufacturer.php
@@ -3,8 +3,8 @@ namespace PartKeepr\PartBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use PartKeepr\ManufacturerBundle\Entity\Manufacturer;
-use PartKeepr\Part\unknown_type;
use PartKeepr\Util\BaseEntity;
+use Symfony\Component\Serializer\Annotation\Groups;
/** @ORM\Entity */
class PartManufacturer extends BaseEntity
@@ -16,14 +16,16 @@ class PartManufacturer extends BaseEntity
/**
* @ORM\ManyToOne(targetEntity="PartKeepr\ManufacturerBundle\Entity\Manufacturer")
+ * @Groups({"default"})
*/
private $manufacturer;
/**
- * @ORM\Column(type="string",nullable=true)
- * Enter description here ...
+ * The part number
*
- * @var unknown_type
+ * @ORM\Column(type="string",nullable=true)
+ * @Groups({"default"})
+ * @var string
*/
private $partNumber;