<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 10/31/18
* Time: 9:04 AM
*/
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="station_expense")
*/
class StationExpense {
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var \App\Entity\Station
* @Serializer\Type("App\Entity\Station")
* @ORM\ManyToOne(targetEntity="App\Entity\Station")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="station_id", referencedColumnName="id")
* })
*/
private $station;
/**
* @var \App\Entity\DailyAccount
* @Serializer\Type("App\Entity\DailyAccount")
* @ORM\ManyToOne(targetEntity="App\Entity\DailyAccount", inversedBy="expensesDetails")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="daily_account_id", referencedColumnName="id", nullable=false)
* })
*/
private $dailyAccount;
/**
* @Assert\NotBlank(message="Please Enter amount")
* @Assert\GreaterThan(value="5", message="Value Cannot be less than KES 5")
* @ORM\Column(type="float")
*/
private $amount;
/**
* @ORM\Column(type="float")
*/
private $expenseAccrued;
/**
* @Assert\NotBlank(message="Please Select type of expense")
* @var \App\Entity\ExpenseType
* @Serializer\Type("App\Entity\ExpenseType")
* @ORM\ManyToOne(targetEntity="App\Entity\ExpenseType")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="expense_type_id", referencedColumnName="id")
* })
*/
private $expenseType;
/**
* @Assert\NotBlank(message="Please Enter description")
* @ORM\Column(type="text")
*/
private $description;
/**
* @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;
/**
* @ORM\Column(type="boolean")
*/
private $isCancelled = false;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return Station
*/
public function getStation()
{
return $this->station;
}
/**
* @param Station $station
*/
public function setStation($station)
{
$this->station = $station;
}
/**
* @return DailyAccount
*/
public function getDailyAccount()
{
return $this->dailyAccount;
}
/**
* @param DailyAccount $dailyAccount
*/
public function setDailyAccount($dailyAccount)
{
$this->dailyAccount = $dailyAccount;
}
/**
* @return mixed
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param mixed $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
/**
* @return mixed
*/
public function getExpenseAccrued()
{
return $this->expenseAccrued;
}
/**
* @param mixed $expenseAccrued
*/
public function setExpenseAccrued($expenseAccrued)
{
$this->expenseAccrued = $expenseAccrued;
}
/**
* @return ExpenseType
*/
public function getExpenseType()
{
return $this->expenseType;
}
/**
* @param ExpenseType $expenseType
*/
public function setExpenseType($expenseType)
{
$this->expenseType = $expenseType;
}
/**
* @return mixed
*/
public function getDescription()
{
return $this->description;
}
/**
* @param mixed $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @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;
}
/**
* @return mixed
*/
public function IsCancelled()
{
return $this->isCancelled;
}
/**
* @param mixed $isCancelled
*/
public function setIsCancelled($isCancelled)
{
$this->isCancelled = $isCancelled;
}
}