_dbh = $dbh; $this->_stmt = $stmt; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Private properties */ private $_stmt; private $_dbh; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Public methods */ public function count () { return count($this->fetchAll()); } public function fetch ( $fetchType=\PDO::FETCH_ASSOC ) { return $this->_stmt->fetch( $fetchType ); } public function fetchAll ( $fetchType=\PDO::FETCH_ASSOC ) { return $this->_stmt->fetchAll( $fetchType ); } public function insertId () { // Only useful after an insert of course... $rows = $this->_stmt->fetchAll(); return $rows[0]['dt_pkey']; } }