/** * @param $id * * @return AB_Customer */ public function getCustomer($id) { $customer = new AB_Customer(); $customer_data = $this->getWpdb()->get_row($this->getWpdb()->prepare('SELECT * FROM `ab_customer` WHERE id = %d', $id)); // populate customer with data if ($customer_data) { $customer->setData($customer_data); } return $customer; }