Skip to content

Commit

Permalink
Merge pull request #56 from MadeWilson/fix/transaction-entity
Browse files Browse the repository at this point in the history
fix/transaction-entity
  • Loading branch information
paulandrieux authored Sep 22, 2017
2 parents 3069eda + e279eb3 commit 927cf30
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Entity/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class Order
protected $status;

/**
* @var string
* @var Transaction
*
* @ORM\OneToOne(targetEntity="Troopers\MangopayBundle\Entity\Transaction", cascade={"remove"})
* @ORM\OneToOne(targetEntity="Troopers\MangopayBundle\Entity\Transaction", cascade={"persist", "remove"})
*/
protected $payinTransaction;

Expand Down Expand Up @@ -113,7 +113,7 @@ public function getStatus()
/**
* Set payinTransaction.
*
* @param int $payinTransaction
* @param Transaction $payinTransaction
*
* @return Order
*/
Expand All @@ -127,7 +127,7 @@ public function setPayinTransaction($payinTransaction)
/**
* Get payinTransaction.
*
* @return int
* @return Transaction
*/
public function getPayinTransaction()
{
Expand Down
27 changes: 25 additions & 2 deletions Entity/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class Transaction implements TransactionInterface
*/
protected $id;

/**
* @var int
*/
protected $mangoId;

/**
* Author Id.
*
Expand Down Expand Up @@ -100,7 +105,7 @@ class Transaction implements TransactionInterface
* Execution date;.
*
* @var \DateTime
* @ORM\Column(name="executionDate", type="datetime")
* @ORM\Column(name="executionDate", type="datetime", nullable=true)
*/
protected $executionDate;

Expand All @@ -124,7 +129,7 @@ class Transaction implements TransactionInterface
* CardType { CB_VISA_MASTERCARD, MAESTRO, DINERS, P24″, MASTERPASS }.
*
* @var string
* @ORM\Column(name="cardType", type="string", length=255)
* @ORM\Column(name="cardType", type="string", length=255, nullable=true)
*/
protected $cardType;

Expand All @@ -138,6 +143,24 @@ protected function getId()
return $this->id;
}

/**
* @return int
*/
public function getMangoId()
{
return $this->mangoId;
}

/**
* @param int $mangoId
* @return Transaction
*/
public function setMangoId($mangoId)
{
$this->mangoId = $mangoId;
return $this;
}

/**
* Get authorId.
*
Expand Down

0 comments on commit 927cf30

Please sign in to comment.