src/Entity/StationExpense.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: parcel
  5.  * Date: 10/31/18
  6.  * Time: 9:04 AM
  7.  */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use JMS\Serializer\Annotation as Serializer;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13.  * @ORM\Entity
  14.  * @ORM\Table(name="station_expense")
  15.  */
  16. class StationExpense {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var \App\Entity\Station
  25.      * @Serializer\Type("App\Entity\Station")
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Station")
  27.      * @ORM\JoinColumns({
  28.      *   @ORM\JoinColumn(name="station_id", referencedColumnName="id")
  29.      * })
  30.      */
  31.     private $station;
  32.     /**
  33.      * @var \App\Entity\DailyAccount
  34.      * @Serializer\Type("App\Entity\DailyAccount")
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\DailyAccount", inversedBy="expensesDetails")
  36.      * @ORM\JoinColumns({
  37.      *   @ORM\JoinColumn(name="daily_account_id", referencedColumnName="id", nullable=false)
  38.      * })
  39.      */
  40.     private $dailyAccount;
  41.     /**
  42.      * @Assert\NotBlank(message="Please Enter amount")
  43.      * @Assert\GreaterThan(value="5", message="Value Cannot be less than KES 5")
  44.      * @ORM\Column(type="float")
  45.      */
  46.     private $amount;
  47.     /**
  48.      * @ORM\Column(type="float")
  49.      */
  50.     private $expenseAccrued;
  51.     /**
  52.      * @Assert\NotBlank(message="Please Select type of expense")
  53.      * @var \App\Entity\ExpenseType
  54.      * @Serializer\Type("App\Entity\ExpenseType")
  55.      * @ORM\ManyToOne(targetEntity="App\Entity\ExpenseType")
  56.      * @ORM\JoinColumns({
  57.      *   @ORM\JoinColumn(name="expense_type_id", referencedColumnName="id")
  58.      * })
  59.      */
  60.     private $expenseType;
  61.     /**
  62.      *  @Assert\NotBlank(message="Please Enter description")
  63.      * @ORM\Column(type="text")
  64.      */
  65.     private $description;
  66.     /**
  67.      * @ORM\Column(type="datetime")
  68.      */
  69.     private $createdAt;
  70.     /**
  71.      * @var \App\Entity\User
  72.      * @Serializer\Type("App\Entity\User")
  73.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  74.      * @ORM\JoinColumns({
  75.      *   @ORM\JoinColumn(name="created_by", referencedColumnName="id")
  76.      * })
  77.      */
  78.     private $createdBy;
  79.     /**
  80.      * @ORM\Column(type="boolean")
  81.      */
  82.     private $isCancelled false;
  83.     /**
  84.      * @return mixed
  85.      */
  86.     public function getId()
  87.     {
  88.         return $this->id;
  89.     }
  90.     /**
  91.      * @param mixed $id
  92.      */
  93.     public function setId($id)
  94.     {
  95.         $this->id $id;
  96.     }
  97.     /**
  98.      * @return Station
  99.      */
  100.     public function getStation()
  101.     {
  102.         return $this->station;
  103.     }
  104.     /**
  105.      * @param Station $station
  106.      */
  107.     public function setStation($station)
  108.     {
  109.         $this->station $station;
  110.     }
  111.     /**
  112.      * @return DailyAccount
  113.      */
  114.     public function getDailyAccount()
  115.     {
  116.         return $this->dailyAccount;
  117.     }
  118.     /**
  119.      * @param DailyAccount $dailyAccount
  120.      */
  121.     public function setDailyAccount($dailyAccount)
  122.     {
  123.         $this->dailyAccount $dailyAccount;
  124.     }
  125.     /**
  126.      * @return mixed
  127.      */
  128.     public function getAmount()
  129.     {
  130.         return $this->amount;
  131.     }
  132.     /**
  133.      * @param mixed $amount
  134.      */
  135.     public function setAmount($amount)
  136.     {
  137.         $this->amount $amount;
  138.     }
  139.     /**
  140.      * @return mixed
  141.      */
  142.     public function getExpenseAccrued()
  143.     {
  144.         return $this->expenseAccrued;
  145.     }
  146.     /**
  147.      * @param mixed $expenseAccrued
  148.      */
  149.     public function setExpenseAccrued($expenseAccrued)
  150.     {
  151.         $this->expenseAccrued $expenseAccrued;
  152.     }
  153.     /**
  154.      * @return ExpenseType
  155.      */
  156.     public function getExpenseType()
  157.     {
  158.         return $this->expenseType;
  159.     }
  160.     /**
  161.      * @param ExpenseType $expenseType
  162.      */
  163.     public function setExpenseType($expenseType)
  164.     {
  165.         $this->expenseType $expenseType;
  166.     }
  167.     /**
  168.      * @return mixed
  169.      */
  170.     public function getDescription()
  171.     {
  172.         return $this->description;
  173.     }
  174.     /**
  175.      * @param mixed $description
  176.      */
  177.     public function setDescription($description)
  178.     {
  179.         $this->description $description;
  180.     }
  181.     /**
  182.      * @return mixed
  183.      */
  184.     public function getCreatedAt()
  185.     {
  186.         return $this->createdAt;
  187.     }
  188.     /**
  189.      * @param mixed $createdAt
  190.      */
  191.     public function setCreatedAt($createdAt)
  192.     {
  193.         $this->createdAt $createdAt;
  194.     }
  195.     /**
  196.      * @return User
  197.      */
  198.     public function getCreatedBy()
  199.     {
  200.         return $this->createdBy;
  201.     }
  202.     /**
  203.      * @param User $createdBy
  204.      */
  205.     public function setCreatedBy($createdBy)
  206.     {
  207.         $this->createdBy $createdBy;
  208.     }
  209.     /**
  210.      * @return mixed
  211.      */
  212.     public function IsCancelled()
  213.     {
  214.         return $this->isCancelled;
  215.     }
  216.     /**
  217.      * @param mixed $isCancelled
  218.      */
  219.     public function setIsCancelled($isCancelled)
  220.     {
  221.         $this->isCancelled $isCancelled;
  222.     }
  223. }