params[$name] = $value; } public function __get($name) { //echo "Getting '$name'\n"; if (array_key_exists($name, $this->params)) { return $this->params[$name]; } $trace = debug_backtrace(); trigger_error( 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_NOTICE); return null; } public function __isset($name) { //echo "Is '$name' set?\n"; return isset($this->params[$name]); } public function __unset($name) { //echo "Unsetting '$name'\n"; unset($this->params[$name]); } public function getCustomers() { return $this->processQuery("SELECT * FROM customer_view ORDER BY customer_id ASC LIMIT ?", ["i", $this->limit]); } public function insertCustomer() { $rowCount = $this->processStatement("CALL insert_new_customer_proc(?,?,?,?,?,?,?,?,?,?)", [$this->first, $this->last, $this->email, $this->phone, $this->birthday, $this->street, $this->city, $this->state, $this->zip, $this->loyalty]); return $rowCount; } public function updateCustomer($id, $param_name, $param_value) { return $this->processStatement("UPDATE customer SET ? = ? WHERE customer_id = ?", [$param_name, $param_value, $id]); } public function deleteCustomer($id) { return $this->processStatement("DELETE FROM customer WHERE customer_id = ?", [$id]); } }