src/Native5/Core/Database/DB.php
protected function prepare($sql) {
        $this->checkConnection();

        $sqlKey = md5($sql);
        if ($this->_statementCache->exists($sqlKey))
            return $this->_statementCache->get($sqlKey);

        try {
            // No need to check the connection again
            $statement = $this->getConnection(false)->prepare($sql);
        } catch (\PDOException $pe) {
            throw new \Exception("Error in preparing statement:: query: ".$sql.PHP_EOL."Message: ".$pe->getMessage());
        }

        $this->_statementCache->set($sqlKey, $statement);
        return $statement;
    }
protected function prepare($sql) {
        $this->checkConnection();

        $sqlKey = md5($sql);
        if ($this->_statementCache->exists($sqlKey))
            return $this->_statementCache->get($sqlKey);

        try {
            // No need to check the connection again
            $statement = $this->getConnection(false)->prepare($sql);
        } catch (\PDOException $pe) {
            throw new \Exception("Error in preparing statement:: query: ".$sql.PHP_EOL."Message: ".$pe->getMessage());
        }

        $this->_statementCache->set($sqlKey, $statement);
        return $statement;
    }
protected function prepare ( $ sql ) { $ this -> checkConnection ( ) ; $ sqlKey = md5 ( $ sql ) ; if ( $ this -> _statementCache -> exists ( $ sqlKey ) ) return $ this -> _statementCache -> get ( $ sqlKey ) ; try { // No need to check the connection again $ statement = $ this -> getConnection ( false ) -> prepare ( $ sql ) ; } catch ( \ PDOException $ pe ) { throw new \ Exception ( "Error in preparing statement:: query: " . $ sql . PHP_EOL . "Message: " . $ pe -> getMessage ( ) ) ; } $ this -> _statementCache -> set ( $ sqlKey , $ statement ) ; return $ statement ; }
prepare Prepare query from sql query

@param string $sql SQL query string

@access protected
@return object prepared statement
@throws Exception if statement could not be prepared successfuly
prepare Prepare query from sql query