root/GearsORM/trunk/docs/files/GearsORM-Model-js.html

Revision 414, 26.9 kB (checked in by uriel, 8 months ago)

*updated docs
*changed version to 0.2.1

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
2
3<html><head><title>GearsORM.Model.js</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script></head><body class=UnframedPage onLoad="NDOnLoad()"><script language=JavaScript><!--
4if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
5
6<!--  Generated by Natural Docs, version 1.35 -->
7<!--  http://www.naturaldocs.org  -->
8
9<!-- saved from url=(0026)http://www.naturaldocs.org -->
10
11<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td class=MenuSection valign=top><!--START_ND_MENU--><div class=MEntry><div class=MFile><a href="GearsORM-Events-js.html">Events.js</a></div></div><div class=MEntry><div class=MFile><a href="GearsORM-Fields-js.html">Fields.js</a></div></div><div class=MEntry><div class=MFile><a href="GearsORM-Introspection-js.html">Introspection.js</a></div></div><div class=MEntry><div class=MFile><a href="GearsORM-js.html">js</a></div></div><div class=MEntry><div class=MFile id=MSelected>Model.js</div></div><div class=MEntry><div class=MFile><a href="GearsORM-ResultIterator-js.html">ResultIterator.js</a></div></div><div class=MEntry><div class=MFile><a href="GearsORM-Sql-js.html">Sql.js</a></div></div><div class=MEntry><div class=MFile><a href="GearsORM-Transaction-js.html">Transaction.js</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Properties.html">Properties</a></div></div></div></div></div><!--END_ND_MENU--></td>
12
13<td class=ContentSection valign=top><div class=CFile id=MainTopic><div class=CTopic><h1 class=CTitle><a name="GearsORM.Model.js"></a>GearsORM.<span class=HB> </span>Model.js</h1><div class=CBody><p class=CParagraph>Contains GearsORM.Model a metaclass used to define models</p><h4 class=CHeading>License</h4><p class=CParagraph>MIT-style license.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr><td class=SEntrySize><div class=SMain><div class=SEntry><a href="#GearsORM.Model.js" >GearsORM.<span class=HB> </span>Model.js</a></div></div></td><td class=SDescriptionSize><div class=SMain><div class=SDescription>Contains GearsORM.Model a metaclass used to define models</div></div></td></tr><tr><td><div class=SClass><div class=SEntry><a href="#GearsORM.Model" >GearsORM.<span class=HB> </span>Model</a></div></div></td><td><div class=SClass><div class=SDescription>a metaclass to define models that represent database tables. </div></div></td></tr><tr><td><div class=SClass><div class=SEntry><a href="#GearsORM.Model.model" >GearsORM.<span class=HB> </span>Model.<span class=HB> </span>model</a></div></div></td><td><div class=SClass><div class=SDescription>represent a model instance</div></div></td></tr><tr><td><div class=SGroup><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.Functions" >Functions</a></div></div></div></td><td><div class=SGroup><div class=SDescription><div class=SIndent1></div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.remove" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">remove</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>remove the instance from the database</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.save" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">save</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2></div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model._updateInsert" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">_updateInsert</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>do the actual insert/update,used by save method.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.refresh" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">refresh</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>refresh the model data from database.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model._populateFromResult" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">_populateFromResult</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>populate the instance from a ResultSet.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.count" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">count</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>do a COUNT on the model</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.select" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">select</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>do a SELECT on the model</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.remove" id=link8 onMouseOver="ShowTip(event, 'tt1', 'link8')" onMouseOut="HideTip('tt1')">remove</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>do a DELETE on the model</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.createTable" id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">createTable</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>create the table for this model,creating triggers for forigenkeys and creating many-to-many tables if needed.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.dropTable" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">dropTable</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>drop the table and all associate triggers.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.createTriggers" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">createTriggers</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>create triggers to inforce forigenkeys.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.dropTriggers" id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">dropTriggers</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>drop triggers related to the table.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#GearsORM.Model.model.load" id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">load</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>load objects from a array to the database.</div></div></div></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
14
15<div class=CClass><div class=CTopic><h2 class=CTitle><a name="GearsORM.Model"></a>GearsORM.<span class=HB> </span>Model</h2><div class=CBody><p class=CParagraph>a metaclass to define models that represent database tables. a metaclass is a class in which the instances are also classes.</p><h4 class=CHeading>Constructor</h4><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>a object used to describe the model look like this: { name : &ldquo;Name of the model table&rdquo;, fields: { name_of_the_field:a_instance_of_GearsORM.Fields.* } }</td></tr></table></div></div></div>
16
17<div class=CClass><div class=CTopic><h2 class=CTitle><a name="GearsORM.Model.model"></a>GearsORM.<span class=HB> </span>Model.<span class=HB> </span>model</h2><div class=CBody><p class=CParagraph>represent a model instance</p><h4 class=CHeading>Constructor</h4><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>valuesOrRowID</td><td class=CDLDescription>(optional)a object used to initialize the model instance with values or it can be the id of the row,in that case it will do a select to retrive the model data.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr><td class=SEntrySize><div class=SGroup><div class=SEntry><a href="#GearsORM.Model.model.Functions" >Functions</a></div></div></td><td class=SDescriptionSize><div class=SGroup><div class=SDescription></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.remove" id=link14 onMouseOver="ShowTip(event, 'tt1', 'link14')" onMouseOut="HideTip('tt1')">remove</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>remove the instance from the database</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.save" id=link15 onMouseOver="ShowTip(event, 'tt2', 'link15')" onMouseOut="HideTip('tt2')">save</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1></div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model._updateInsert" id=link16 onMouseOver="ShowTip(event, 'tt3', 'link16')" onMouseOut="HideTip('tt3')">_updateInsert</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>do the actual insert/update,used by save method.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.refresh" id=link17 onMouseOver="ShowTip(event, 'tt4', 'link17')" onMouseOut="HideTip('tt4')">refresh</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>refresh the model data from database.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model._populateFromResult" id=link18 onMouseOver="ShowTip(event, 'tt5', 'link18')" onMouseOut="HideTip('tt5')">_populateFromResult</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>populate the instance from a ResultSet.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.count" id=link19 onMouseOver="ShowTip(event, 'tt6', 'link19')" onMouseOut="HideTip('tt6')">count</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>do a COUNT on the model</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.select" id=link20 onMouseOver="ShowTip(event, 'tt7', 'link20')" onMouseOut="HideTip('tt7')">select</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>do a SELECT on the model</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.remove" id=link21 onMouseOver="ShowTip(event, 'tt1', 'link21')" onMouseOut="HideTip('tt1')">remove</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>do a DELETE on the model</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.createTable" id=link22 onMouseOver="ShowTip(event, 'tt8', 'link22')" onMouseOut="HideTip('tt8')">createTable</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>create the table for this model,creating triggers for forigenkeys and creating many-to-many tables if needed.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.dropTable" id=link23 onMouseOver="ShowTip(event, 'tt9', 'link23')" onMouseOut="HideTip('tt9')">dropTable</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>drop the table and all associate triggers.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.createTriggers" id=link24 onMouseOver="ShowTip(event, 'tt10', 'link24')" onMouseOut="HideTip('tt10')">createTriggers</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>create triggers to inforce forigenkeys.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.dropTriggers" id=link25 onMouseOver="ShowTip(event, 'tt11', 'link25')" onMouseOut="HideTip('tt11')">dropTriggers</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>drop triggers related to the table.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent1><a href="#GearsORM.Model.model.load" id=link26 onMouseOver="ShowTip(event, 'tt12', 'link26')" onMouseOut="HideTip('tt12')">load</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent1>load objects from a array to the database.</div></div></div></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
18
19<div class=CGroup><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.Functions"></a>Functions</h3></div></div>
20
21<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.remove"></a>remove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>remove:function()</td></tr></table></blockquote><p class=CParagraph>remove the instance from the database</p></div></div></div>
22
23<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.save"></a>save</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>save:function()</td></tr></table></blockquote><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>save the instance to the database,if the instance is not in the database</td><td class=CDLDescription>it will be created. if it is already in the database it will be updated.</td></tr></table></div></div></div>
24
25<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model._updateInsert"></a>_updateInsert</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_updateInsert:function(</td><td class=PParameter nowrap>update</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>do the actual insert/update,used by save method.</p></div></div></div>
26
27<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.refresh"></a>refresh</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>refresh:function()</td></tr></table></blockquote><p class=CParagraph>refresh the model data from database.</p></div></div></div>
28
29<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model._populateFromResult"></a>_populateFromResult</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_populateFromResult:function(</td><td class=PParameter nowrap>result</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>populate the instance from a ResultSet.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>result</td><td class=CDLDescription>a ResultSet that used to populate the instance.</td></tr></table></div></div></div>
30
31<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.count"></a>count</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>count:function(</td><td class=PParameter nowrap>whereExpression,</td></tr><tr><td></td><td class=PParameter nowrap>params</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>do a COUNT on the model</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>whereExpression</td><td class=CDLDescription>a SQL expression to be used as the WHERE clause.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>bind parameters used in the SQL expression.</td></tr></table><h4 class=CHeading>Returns</h4><p class=CParagraph>how much objects(rows) match the where expression</p></div></div></div>
32
33<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.select"></a>select</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>select:function(</td><td class=PParameter nowrap>whereExpression,</td></tr><tr><td></td><td class=PParameter nowrap>params</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>do a SELECT on the model</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>whereExpression</td><td class=CDLDescription>a SQL expression to be used as the WHERE clause.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>bind parameters used in the SQL expression.</td></tr></table><h4 class=CHeading>Returns</h4><p class=CParagraph>a new ResultIterator to iterate the ResultSet</p></div></div></div>
34
35<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.remove"></a>remove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>remove:function(</td><td class=PParameter nowrap>whereExpression,</td></tr><tr><td></td><td class=PParameter nowrap>params</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>do a DELETE on the model</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>whereExpression</td><td class=CDLDescription>a SQL expression to be used as the WHERE clause.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>bind parameters used in the SQL expression.</td></tr></table></div></div></div>
36
37<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.createTable"></a>createTable</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createTable:function()</td></tr></table></blockquote><p class=CParagraph>create the table for this model,creating triggers for forigenkeys and creating many-to-many tables if needed.</p></div></div></div>
38
39<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.dropTable"></a>dropTable</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>dropTable:function()</td></tr></table></blockquote><p class=CParagraph>drop the table and all associate triggers.</p></div></div></div>
40
41<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.createTriggers"></a>createTriggers</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createTriggers:function()</td></tr></table></blockquote><p class=CParagraph>create triggers to inforce forigenkeys.</p></div></div></div>
42
43<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.dropTriggers"></a>dropTriggers</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>dropTriggers:function()</td></tr></table></blockquote><p class=CParagraph>drop triggers related to the table.</p></div></div></div>
44
45<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="GearsORM.Model.model.load"></a>load</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>load:function(</td><td class=PParameter nowrap>objects,</td></tr><tr><td></td><td class=PParameter nowrap>save</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>load objects from a array to the database.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>objects</td><td class=CDLDescription>a array of objects or one object to be saved in the database.</td></tr><tr><td class=CDLEntry>save</td><td class=CDLDescription>if set to true all the objects will be saved to the database.</td></tr></table><h4 class=CHeading>Returns</h4><p class=CParagraph>return all the objects mapped using the model class.</p></div></div></div>
46
47</td>
48
49</tr></table><div class=Footer><!--START_ND_FOOTER-->Generated by <a href="http://www.naturaldocs.org">Natural Docs</a><!--END_ND_FOOTER--></div>
50<!--START_ND_TOOLTIPS-->
51<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>remove:function()</td></tr></table></blockquote>remove the instance from the database</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>save:function()</td></tr></table></blockquote></div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_updateInsert:function(</td><td class=PParameter nowrap>update</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>do the actual insert/update,used by save method.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>refresh:function()</td></tr></table></blockquote>refresh the model data from database.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>_populateFromResult:function(</td><td class=PParameter nowrap>result</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>populate the instance from a ResultSet.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>count:function(</td><td class=PParameter nowrap>whereExpression,</td></tr><tr><td></td><td class=PParameter nowrap>params</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>do a COUNT on the model</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>select:function(</td><td class=PParameter nowrap>whereExpression,</td></tr><tr><td></td><td class=PParameter nowrap>params</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>do a SELECT on the model</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createTable:function()</td></tr></table></blockquote>create the table for this model,creating triggers for forigenkeys and creating many-to-many tables if needed.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>dropTable:function()</td></tr></table></blockquote>drop the table and all associate triggers.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createTriggers:function()</td></tr></table></blockquote>create triggers to inforce forigenkeys.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>dropTriggers:function()</td></tr></table></blockquote>drop triggers related to the table.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>load:function(</td><td class=PParameter nowrap>objects,</td></tr><tr><td></td><td class=PParameter nowrap>save</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>load objects from a array to the database.</div></div><!--END_ND_TOOLTIPS-->
52
53<script language=JavaScript><!--
54if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>
Note: See TracBrowser for help on using the browser.