2 namespace Stock\Entity;
4 use Doctrine\ORM\Mapping as ORM;
11 * @ORM\HasLifecycleCallbacks
12 * @ORM\Table(name="vehicle_pricing_history")
18 * Can archive records.
22 * Pull Synchronization Strategy for this table.
24 const PULL_SYNCH_STRATEGY = false;
26 * Push Synchronization Strategy for this table.
28 const PUSH_SYNCH_STRATEGY = false;
30 * Post insert action must be called after new entity is flushed to database.
32 const HAVE_POST_INSERT = true;
36 * @ORM\Column(type="integer");
37 * @ORM\GeneratedValue(strategy="AUTO")
42 * @ORM\Column(type="datetime", nullable=true, name="date");)
47 * @ORM\Column(type="decimal", scale=2, precision=11, nullable=false, name="trade", options={"unsigned"=true});
49 protected $trade = 0.0;
52 * @ORM\Column(type="decimal", scale=2, precision=11, nullable=false, name="list_price", options={"unsigned"=true});
54 protected $listPrice = 0.0;
57 * @ORM\Column(type="decimal", scale=2, precision=11, nullable=false, name="total_recon", options={"unsigned"=true});
59 protected $totalRecon = 0.0;
62 * @ORM\Column(type="integer", nullable=false, name="km", options={"unsigned"=true})
67 * @ORM\Column(type="decimal", scale=2, precision=11, nullable=false, name="priceg_offer", options={"unsigned"=true});
69 protected $pricegOffer = 0.0;
73 * @ORM\Column(type="decimal", scale=2, precision=11, nullable=false, name="auction_winbid", options={"unsigned"=true});
75 protected $auctionWinningBid = 0.0;
79 * @ORM\Column(type="integer", nullable=false, name="stock_id");
81 protected $stockId = 0;
85 * Magic getter to expose protected properties.
86 * @param string $property
89 public function __get($property)
91 return $this->$property;
95 * Magic setter to save protected properties.
96 * @param string $property
99 public function __set($property, $value)
101 $this->$property = $value;
105 * Convert the object to an array.
106 * @param array $expand
107 * @param array $intersect
110 public function toArray(array $expand = array(), array $intersect = array())
113 $includeAll = empty($intersect);
115 ($includeAll || isset($intersect['id']))
116 && $data['id'] = $this->id;
117 ($includeAll || isset($intersect['date']))
118 && $data['date'] = $this->date;
119 ($includeAll || isset($intersect['trade']))
120 && $data['trade'] = $this->trade;
121 ($includeAll || isset($intersect['listPrice']))
122 && $data['listPrice'] = $this->listPrice;
123 ($includeAll || isset($intersect['totalRecon']))
124 && $data['totalRecon'] = $this->totalRecon;
125 ($includeAll || isset($intersect['km']))
126 && $data['km'] = $this->km;
127 ($includeAll || isset($intersect['pricegOffer']))
128 && $data['pricegOffer'] = $this->pricegOffer;
129 ($includeAll || isset($intersect['auctionWinningBid']))
130 && $data['auctionWinningBid'] = $this->auctionWinningBid;
131 ($includeAll || isset($intersect['stockId']))
132 && $data['stockId'] = $this->stockId;
138 * Convert the object to an array for synchronization.
141 public function toSynchArray()
145 'date' => $this->date,
146 'trade' => $this->trade,
147 'listPrice' => $this->listPrice,
148 'totalRecon' => $this->totalRecon,
150 'pricegOffer' => $this->pricegOffer,
151 'auctionWinningBid' => $this->auctionWinningBid,
152 'stockId' => $this->stockId
157 * Populate from an array.
160 public function fromArray($data = array())
163 && $this->id = $data['id'];
165 && $this->date = $data['date'];
166 isset($data['trade'])
167 && $this->trade = $data['trade'];
168 isset($data['listPrice'])
169 && $this->listPrice = $data['listPrice'];
170 isset($data['totalRecon'])
171 && $this->totalRecon = $data['totalRecon'];
173 && $this->km = $data['km'];
174 isset($data['pricegOffer'])
175 && $this->pricegOffer = $data['pricegOffer'];
176 isset($data['auctionWinningBid'])
177 && $this->auctionWinningBid = $data['auctionWinningBid'];
178 isset($data['stockId'])
179 && $this->stockId = $data['stockId'];