Just a couple of things: - public function getPart($part) + public function &getPart($part) // Returns part by reference instead of as a copy to conserve memory
public function reset($part = null) { if ($part == null) { - $this->_parts = $this->_partsInit; + $this->_parts = self::$_partsInit; } else if (array_key_exists($part, $this->_partsInit)) { - $this->_parts[$part] = $this->_partsInit[$part]; + $this->_parts[$part] = self::$_partsInit[$part]; } } I noticed the new code is adding aliases to the column names which is bombing in certain cases: $select->from( 'user', 'Count(*)' ); $select->where( 'ID = ?', $id ); echo $select->__toString(); Output: SELECT user_1.Count(*) FROM user user_1 WHERE ID = 1 The above is not a valid SQL statement. I guess we need to either remove the aliasing logic or provide an additional argument (default true) to prefix aliases or not. Regards,