khanat-code-old/code/web/docs/ams/html/classDBLayer.html

285 lines
12 KiB
HTML
Raw Normal View History

2014-06-12 17:27:09 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Ryzom Account Management System: DBLayer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Ryzom Account Management System
&#160;<span id="projectnumber">1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> </div>
<div class="headertitle">
<div class="title">DBLayer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="DBLayer" -->
<p>Handles the database connections.
<a href="classDBLayer.html#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDBLayer.html#a800f8efee13692788b13ee57c5960092">__construct</a> ($db)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The constructor. <a href="#a800f8efee13692788b13ee57c5960092"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDBLayer.html#a33552c5325c469ac1aa0d049d2312468">executeWithoutParams</a> ($query)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">execute a query that doesn't have any parameters <a href="#a33552c5325c469ac1aa0d049d2312468"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDBLayer.html#a9a0e3ecb193fecd94263eda79c54bcc4">execute</a> ($query, $params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">execute a query that has parameters <a href="#a9a0e3ecb193fecd94263eda79c54bcc4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDBLayer.html#a9a8137347ec2d551de3ec54cfb3bdb1a">executeReturnId</a> ($query, $params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">execute a query (an insertion query) that has parameters and return the id of it's insertion <a href="#a9a8137347ec2d551de3ec54cfb3bdb1a"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDBLayer.html#acdb2149c05a21fe144fb05ec524a51f3">$PDO</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The PDO object, instantiated by the constructor. <a href="#acdb2149c05a21fe144fb05ec524a51f3"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Handles the database connections. </p>
<p>It uses PDO to connect to the different databases. It will use the argument of the constructor to setup a connection to the database with the matching entry in the $cfg global variable. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Daan Janssens, mentored by Matthew Lagoe </dd></dl>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a800f8efee13692788b13ee57c5960092"></a><!-- doxytag: member="DBLayer::__construct" ref="a800f8efee13692788b13ee57c5960092" args="($db)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classDBLayer.html#a800f8efee13692788b13ee57c5960092">__construct</a> </td>
<td>(</td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>db</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The constructor. </p>
<p>Instantiates the PDO object attribute by connecting to the arguments matching database(the db info is stored in the $cfg global var) </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">$db</td><td>String, the name of the databases entry in the $cfg global var. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a9a0e3ecb193fecd94263eda79c54bcc4"></a><!-- doxytag: member="DBLayer::execute" ref="a9a0e3ecb193fecd94263eda79c54bcc4" args="($query, $params)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classDBLayer.html#a9a0e3ecb193fecd94263eda79c54bcc4">execute</a> </td>
<td>(</td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>query</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>params</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>execute a query that has parameters </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">$query</td><td>the mysql query </td></tr>
<tr><td class="paramname">$params</td><td>the parameters that are being used by the query </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>returns a PDOStatement object </dd></dl>
</div>
</div>
<a class="anchor" id="a9a8137347ec2d551de3ec54cfb3bdb1a"></a><!-- doxytag: member="DBLayer::executeReturnId" ref="a9a8137347ec2d551de3ec54cfb3bdb1a" args="($query, $params)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classDBLayer.html#a9a8137347ec2d551de3ec54cfb3bdb1a">executeReturnId</a> </td>
<td>(</td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>query</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>params</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>execute a query (an insertion query) that has parameters and return the id of it's insertion </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">$query</td><td>the mysql query </td></tr>
<tr><td class="paramname">$params</td><td>the parameters that are being used by the query </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>returns the id of the last inserted element. </dd></dl>
</div>
</div>
<a class="anchor" id="a33552c5325c469ac1aa0d049d2312468"></a><!-- doxytag: member="DBLayer::executeWithoutParams" ref="a33552c5325c469ac1aa0d049d2312468" args="($query)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classDBLayer.html#a33552c5325c469ac1aa0d049d2312468">executeWithoutParams</a> </td>
<td>(</td>
<td class="paramtype">$&#160;</td>
<td class="paramname"><em>query</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>execute a query that doesn't have any parameters </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">$query</td><td>the mysql query </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>returns a PDOStatement object </dd></dl>
</div>
</div>
<hr/><h2>Field Documentation</h2>
<a class="anchor" id="acdb2149c05a21fe144fb05ec524a51f3"></a><!-- doxytag: member="DBLayer::$PDO" ref="acdb2149c05a21fe144fb05ec524a51f3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">$PDO<code> [private]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The PDO object, instantiated by the constructor. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/daan/ryzom/ryzomcore/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/<a class="el" href="dblayer_8php.html">dblayer.php</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 15 2013 17:49:37 for Ryzom Account Management System by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>