initial commit
[namibia] / module / Adherence / src / Adherence / Entity / TradeSales.php
1 <?php
2
3 namespace Adherence\Entity;
4
5 use Doctrine\ORM\Mapping as ORM;
6
7 /**
8  * @ORM\Entity
9  * @ORM\HasLifecycleCallbacks
10  * @ORM\Table(name="trade_sales")
11  */
12 class TradeSales
13 {
14
15   /**
16    * Can archive records.
17    */
18   const ARCHIVE = false;
19
20   /**
21    * Pull Synchronization Strategy for this table.
22    */
23   const PULL_SYNCH_STRATEGY = false;
24
25   /**
26    * Push Synchronization Strategy for this table.
27    */
28   const PUSH_SYNCH_STRATEGY = false;
29
30   /**
31    * @ORM\Id
32    * @ORM\Column(type="integer");
33    * @ORM\GeneratedValue(strategy="AUTO")
34    */
35   protected $id;
36
37   /**
38    * @ORM\Column(type="string", length=128, name="dealer_name")
39    */
40   protected $dealerName;
41
42   /**
43    * @ORM\Column(type="string", length=45, name="stock_number")
44    */
45   protected $stockNumber;
46
47   /**
48    * @ORM\Column(type="string", length=45, name="invoice_number")
49    */
50   protected $invoiceNumber;
51
52   /**
53    * @ORM\Column(type="string", length=45, name="reg_number")
54    */
55   protected $regNumber;
56
57   /**
58    * @ORM\Column(type="string", length=45, name="vin_number")
59    */
60   protected $vinNumber;
61
62   /**
63    * @ORM\Column(type="string", length=45, name="vehicle_make")
64    */
65   protected $vehicleMake;
66
67   /**
68    * @ORM\Column(type="datetime", nullable=true, name="reg_date");
69    */
70   protected $regDate;
71
72   /**
73    * @ORM\Column(type="datetime", nullable=true, name="sale_date");
74    */
75   protected $saleDate;
76
77   /**
78    * @ORM\Column(type="string", length=45, name="sale_type")
79    */
80   protected $saleType;
81
82   /**
83    * @ORM\Column(type="decimal", scale=4, precision=13, nullable=false, name="total_cost", options={"unsigned"=false});
84    */
85   protected $totalCost;
86
87   /**
88    * @ORM\Column(type="decimal", scale=4, precision=13, nullable=false, name="sales_total", options={"unsigned"=false});
89    */
90   protected $salesTotal;
91
92   /**
93    * @ORM\Column(type="string", length=128, name="sold_to")
94    */
95   protected $soldTo;
96
97   /**
98    * @ORM\ManyToOne(targetEntity="\Stock\Entity\Stock")
99    * @ORM\JoinColumn(nullable=true, name="stock_id")
100    * */
101   protected $stock;
102
103   /**
104    * @ORM\Column(nullable=true, type="boolean", name="vin_match");
105    */
106   protected $vinMatch;
107
108   /**
109    * @ORM\Column(nullable=true, type="boolean", name="reg_match");
110    */
111   protected $regMatch;
112
113   /**
114    * Initialize collections.
115    */
116   public function __construct()
117   {
118     
119   }
120
121   /**
122    * Magic getter to expose protected properties.
123    * @param string $property
124    * @return mixed
125    */
126   public function __get($property)
127   {
128     return $this->$property;
129   }
130
131   /**
132    * Magic setter to save protected properties.
133    * @param string $property
134    * @param mixed $value
135    */
136   public function __set($property, $value)
137   {
138     $this->$property = $value;
139   }
140
141   public function fromArray($data)
142   {
143     isset($data['dealerName']) && $this->dealerName = $data['dealerName'];
144     isset($data['stockNumber']) && $this->stockNumber = $data['stockNumber'];
145     isset($data['invoiceNumber']) && $this->invoiceNumber = $data['invoiceNumber'];
146     isset($data['regNumber']) && $this->regNumber = $data['regNumber'];
147     isset($data['vinNumber']) && $this->vinNumber = $data['vinNumber'];
148     isset($data['vehicleMake']) && $this->vehicleMake = $data['vehicleMake'];
149     isset($data['regDate']) && $this->regDate = $data['regDate'];
150     isset($data['saleDate']) && $this->saleDate = $data['saleDate'];
151     isset($data['saleType']) && $this->saleType = $data['saleType'];
152     isset($data['totalCost']) && $this->totalCost = $data['totalCost'];
153     isset($data['salesTotal']) && $this->salesTotal = $data['salesTotal'];
154     isset($data['soldTo']) && $this->soldTo = $data['soldTo'];
155     isset($data['stock']) && $this->stock = $data['stock'];
156     isset($data['vinMatch']) && $this->vinMatch = $data['vinMatch'];
157     isset($data['regMatch']) && $this->regMatch = $data['regMatch'];
158   }
159
160   public function toArray()
161   {
162     return array(
163       'id' => $this->id,
164       'dealerName' => $this->dealerName,
165       'stockNumber' => $this->stockNumber,
166       'invoiceNumber' => $this->invoiceNumber,
167       'regNumber' => $this->regNumber,
168       'vinNumber' => $this->vinNumber,
169       'vehicleMake' => $this->vehicleMake,
170       'regDate' => $this->regDate,
171       'saleDate' => $this->saleDate,
172       'saleType' => $this->saleType,
173       'totalCost' => $this->totalCost,
174       'salesTotal' => $this->salesTotal,
175       'soldTo' => $this->soldTo,
176       'stock' => $this->stock,
177       'vinMatch' => $this->vinMatch,
178       'regMatch' => $this->regMatch
179     );
180   }
181
182 }