$property; } /** * Magic setter to save protected properties. * @param string $property * @param mixed $value */ public function __set($property, $value) { $this->$property = $value; } public function fromArray($data) { isset($data['dealerName']) && $this->dealerName = $data['dealerName']; isset($data['stockNumber']) && $this->stockNumber = $data['stockNumber']; isset($data['invoiceNumber']) && $this->invoiceNumber = $data['invoiceNumber']; isset($data['regNumber']) && $this->regNumber = $data['regNumber']; isset($data['vinNumber']) && $this->vinNumber = $data['vinNumber']; isset($data['vehicleMake']) && $this->vehicleMake = $data['vehicleMake']; isset($data['regDate']) && $this->regDate = $data['regDate']; isset($data['saleDate']) && $this->saleDate = $data['saleDate']; isset($data['saleType']) && $this->saleType = $data['saleType']; isset($data['totalCost']) && $this->totalCost = $data['totalCost']; isset($data['salesTotal']) && $this->salesTotal = $data['salesTotal']; isset($data['soldTo']) && $this->soldTo = $data['soldTo']; isset($data['stock']) && $this->stock = $data['stock']; isset($data['vinMatch']) && $this->vinMatch = $data['vinMatch']; isset($data['regMatch']) && $this->regMatch = $data['regMatch']; } public function toArray() { return array( 'id' => $this->id, 'dealerName' => $this->dealerName, 'stockNumber' => $this->stockNumber, 'invoiceNumber' => $this->invoiceNumber, 'regNumber' => $this->regNumber, 'vinNumber' => $this->vinNumber, 'vehicleMake' => $this->vehicleMake, 'regDate' => $this->regDate, 'saleDate' => $this->saleDate, 'saleType' => $this->saleType, 'totalCost' => $this->totalCost, 'salesTotal' => $this->salesTotal, 'soldTo' => $this->soldTo, 'stock' => $this->stock, 'vinMatch' => $this->vinMatch, 'regMatch' => $this->regMatch ); } }