_fields = $fields; return $this; } /** * * @param string $table * @param string $alias * @return SQL */ public function from($table, $alias) { $this->_from[] = $table . ' AS ' . $alias; return $this; } /** * @param string $condition * @return SQL */ public function where($condition) { $this->_where[] = $condition; return $this; } } $instance = new SQL(); $instance->select(array('foo', 'bar')) ->from('foobar', 'f') ->where('f.bar = ?');