_columns[] = $column; return $this; } public function table ($table) { $this->_table[] = $table; return $this; } public function values ($values) { $this->_values[] = $values; return $this; } public function where ($column, $type, $value) { $this->_where[] = $column . ' ' . $type . ' ' . $value; return $this; } public function type ($type) { $this->_type = $type; return $this; } public function joinTable ($type, $table) { $this->_joinTable[] = $type . ' ' . $table; return $this; } public function fetch () { $data = $this->_query (); return $data; } public function _query () { switch ($this->_type) { case 'select': $query = 'SELECT '; $query .= implode (',', $this->_columns); $query .= ' FROM ' . current ($this->_table); $where = array (); if (!empty ($this->_where)) { $query .= ' WHERE ' . implode (' AND ', $this->_where); } parent::query ($query); $data = parent::fetch (); break; } var_dump ($query, $data); return $data; } public function _get () { //var_dump ($this); } }