public function query($sql, $bind = array())
    {
        if (!is_string($sql)) {
            return parent::query($sql, $bind);
        }

        if (isset($this->cachePreparedStatement[$sql])) {
            if (!is_array($bind)) {
                $bind = array($bind);
            }

            $stmt = $this->cachePreparedStatement[$sql];
            $stmt->execute($bind);
            return $stmt;
        }

        $stmt = parent::query($sql, $bind);
        $this->cachePreparedStatement[$sql] = $stmt;
        return $stmt;
    }
public function query($sql, $bind = array())
    {
        if (!is_string($sql)) {
            return parent::query($sql, $bind);
        }

        if (isset($this->cachePreparedStatement[$sql])) {
            if (!is_array($bind)) {
                $bind = array($bind);
            }

            $stmt = $this->cachePreparedStatement[$sql];
            $stmt->execute($bind);
            return $stmt;
        }

        $stmt = parent::query($sql, $bind);
        $this->cachePreparedStatement[$sql] = $stmt;
        return $stmt;
    }
public function query ( $ sql , $ bind = array ( ) ) { if ( ! is_string ( $ sql ) ) { return parent :: query ( $ sql , $ bind ) ; } if ( isset ( $ this -> cachePreparedStatement [ $ sql ] ) ) { if ( ! is_array ( $ bind ) ) { $ bind = array ( $ bind ) ; } $ stmt = $ this -> cachePreparedStatement [ $ sql ] ; $ stmt -> execute ( $ bind ) ; return $ stmt ; } $ stmt = parent :: query ( $ sql , $ bind ) ; $ this -> cachePreparedStatement [ $ sql ] = $ stmt ; return $ stmt ; }
Prepares and executes an SQL statement with bound data.
Caches prepared statements to avoid preparing the same query more than once

@param string|Zend_Db_Select $sql The SQL statement with placeholders.
@param array $bind An array of data to bind to the placeholders.
@return Zend_Db_Statement_Interface
Prepares and executes an SQL statement with bound data . Caches prepared statements to avoid preparing the same query more than once