Skip to content

Commit

Permalink
Added set id function
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Jan 3, 2020
1 parent 0379cc0 commit 5de1ee3
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 27 deletions.
14 changes: 11 additions & 3 deletions api/src/Entity/Catalogue.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing a product catalogue.
Expand Down Expand Up @@ -122,10 +123,17 @@ public function __construct()
$this->groups = new ArrayCollection();
$this->products = new ArrayCollection();
}

public function getId()

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getName(): ?string
Expand Down
14 changes: 11 additions & 3 deletions api/src/Entity/CustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing a type of customer.
Expand Down Expand Up @@ -84,10 +85,17 @@ public function __construct()
{
$this->offers = new ArrayCollection();
}

public function getId(): ?string

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getName(): ?string
Expand Down
14 changes: 11 additions & 3 deletions api/src/Entity/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing a product group.
Expand Down Expand Up @@ -124,10 +125,17 @@ public function __construct()
$this->products = new ArrayCollection();
$this->services = new ArrayCollection();
}

public function getId()

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getName(): ?string
Expand Down
14 changes: 11 additions & 3 deletions api/src/Entity/Offer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing an offer.
Expand Down Expand Up @@ -162,10 +163,17 @@ public function __construct()
{
$this->eligibleCustomerTypes = new ArrayCollection();
}

public function getId(): ?string

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getName(): ?string
Expand Down
17 changes: 9 additions & 8 deletions api/src/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing a product.
Expand Down Expand Up @@ -303,17 +304,17 @@ public function __construct()
$this->sets = new ArrayCollection();
$this->offers = new ArrayCollection();
}

public function getId()
public function getId(): Uuid
{
return $this->id;
return $this->id;
}

public function setId($id): self
public function setId(Uuid $id): self
{
$this->id = $id;

return $this;
$this->id = $id;
return $this;
}

public function getSku(): ?string
Expand Down
16 changes: 12 additions & 4 deletions api/src/Entity/Supplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing a supplier of products.
Expand Down Expand Up @@ -81,11 +82,18 @@ class Supplier
* @Groups({"read","write"})
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $logo;

public function getId()
private $logo;

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getSourceOrganization(): ?string
Expand Down
14 changes: 11 additions & 3 deletions api/src/Entity/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Ramsey\Uuid\Uuid;

/**
* An entity representing an tax.
Expand Down Expand Up @@ -113,10 +114,17 @@ public function __construct()
{
$this->eligibleCustomerTypes = new ArrayCollection();
}

public function getId(): ?string

public function getId(): Uuid
{
return $this->id;
}

public function setId(Uuid $id): self
{
return $this->id;
$this->id = $id;

return $this;
}

public function getName(): ?string
Expand Down

0 comments on commit 5de1ee3

Please sign in to comment.