Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // src/App/Entity
- namespace App\Entity;
- use Beelab\PaypalBundle\Entity\Transaction as BaseTransaction;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Table()
- * @ORM\Entity()
- */
- class Transaction extends BaseTransaction
- {
- // if you need other properties, or relationships, add them here...
- /**
- * @ORM\Column(type="text", nullable=TRUE)
- */
- protected $description;
- /**
- *
- * @ORM\OneToMany(targetEntity="Item", mappedBy="transaction")
- */
- protected $items;
- public function __construct() {
- $this->items=new ArrayCollection();
- }
- /**
- * @ORM\Column(type="float", nullable=TRUE)
- */
- private $shippingAmount;
- public function getDescription(): ?string
- {
- return $this->description;
- }
- public function setDescription(?string $description): self
- {
- $this->description = $description;
- return $this;
- }
- public function getShippingAmount(): string
- {
- return '';
- }
- public function setShippingAmount(?float $shippingAmount): self
- {
- $this->shippingAmount = $shippingAmount;
- return $this;
- }
- public function getItems(): array
- {
- return [];
- }
- public function addItem(Item $item): self
- {
- if (!$this->items->contains($item)) {
- $this->items[] = $item;
- $item->setTransaction($this);
- }
- return $this;
- }
- public function removeItem(Item $item): self
- {
- if ($this->items->contains($item)) {
- $this->items->removeElement($item);
- // set the owning side to null (unless already changed)
- if ($item->getTransaction() === $this) {
- $item->setTransaction(null);
- }
- }
- return $this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement