3 namespace Adherence\Entity;
5 use Doctrine\ORM\Mapping as ORM;
9 * @ORM\HasLifecycleCallbacks
10 * @ORM\Table(name="trade_sales")
16 * Can archive records.
18 const ARCHIVE = false;
21 * Pull Synchronization Strategy for this table.
23 const PULL_SYNCH_STRATEGY = false;
26 * Push Synchronization Strategy for this table.
28 const PUSH_SYNCH_STRATEGY = false;
32 * @ORM\Column(type="integer");
33 * @ORM\GeneratedValue(strategy="AUTO")
38 * @ORM\Column(type="string", length=128, name="dealer_name")
40 protected $dealerName;
43 * @ORM\Column(type="string", length=45, name="stock_number")
45 protected $stockNumber;
48 * @ORM\Column(type="string", length=45, name="invoice_number")
50 protected $invoiceNumber;
53 * @ORM\Column(type="string", length=45, name="reg_number")
58 * @ORM\Column(type="string", length=45, name="vin_number")
63 * @ORM\Column(type="string", length=45, name="vehicle_make")
65 protected $vehicleMake;
68 * @ORM\Column(type="datetime", nullable=true, name="reg_date");
73 * @ORM\Column(type="datetime", nullable=true, name="sale_date");
78 * @ORM\Column(type="string", length=45, name="sale_type")
83 * @ORM\Column(type="decimal", scale=4, precision=13, nullable=false, name="total_cost", options={"unsigned"=false});
88 * @ORM\Column(type="decimal", scale=4, precision=13, nullable=false, name="sales_total", options={"unsigned"=false});
90 protected $salesTotal;
93 * @ORM\Column(type="string", length=128, name="sold_to")
98 * @ORM\ManyToOne(targetEntity="\Stock\Entity\Stock")
99 * @ORM\JoinColumn(nullable=true, name="stock_id")
104 * @ORM\Column(nullable=true, type="boolean", name="vin_match");
109 * @ORM\Column(nullable=true, type="boolean", name="reg_match");
114 * Initialize collections.
116 public function __construct()
122 * Magic getter to expose protected properties.
123 * @param string $property
126 public function __get($property)
128 return $this->$property;
132 * Magic setter to save protected properties.
133 * @param string $property
134 * @param mixed $value
136 public function __set($property, $value)
138 $this->$property = $value;
141 public function fromArray($data)
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'];
160 public function toArray()
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