<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 10/19/18
* Time: 12:49 PM
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="transaction_expense")
*/
class TransactionExpense {
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Assert\NotBlank(message="Please Enter Amount")
* @Assert\GreaterThanOrEqual(value="10", message="Please Enter A value More than 150")
* @ORM\Column(type="float")
*/
private $amount;
/**
* @var \App\Entity\Transaction
* @Serializer\Type("App\Entity\Transaction")
* @ORM\ManyToOne(targetEntity="Transaction", inversedBy="wayBillExpenses")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="transaction_id", referencedColumnName="id")
* })
*/
private $transaction;
/**
* @var \App\Entity\ExpenseType
* @Serializer\Type("App\Entity\ExpenseType")
* @ORM\ManyToOne(targetEntity="App\Entity\ExpenseType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="expense_type", referencedColumnName="id")
* })
*/
private $expenseType;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @var \App\Entity\User
* @Serializer\Type("App\Entity\User")
* @ORM\ManyToOne(targetEntity="App\Entity\User")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="created_by", referencedColumnName="id")
* })
*/
private $createdBy;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param mixed $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
/**
* @return Transaction
*/
public function getTransaction()
{
return $this->transaction;
}
/**
* @param Transaction $transaction
*/
public function setTransaction($transaction)
{
$this->transaction = $transaction;
}
/**
* @return ExpenseType
*/
public function getExpenseType()
{
return $this->expenseType;
}
/**
* @param ExpenseType $expenseType
*/
public function setExpenseType($expenseType)
{
$this->expenseType = $expenseType;
}
/**
* @return mixed
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param mixed $createdAt
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return User
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @param User $createdBy
*/
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
}
}