Menu

[r3190]: / trunk / ch.sahits.codegen.help / html / gettingstarted / exampleTemplate.xml  Maximize  Restore  History

Download this file

71 lines (71 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Andi Hotz (SAHITS) -->
<phpClassTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sahits.ch/xsd/phpClassTemplate.xsd">
<include>MySQLDAO.php</include>
<include>Security.php</include>
<member name="dao"/>
<member name="i" value="1"/>
<member name="dbHost" value="'DB_HOST'"/>
<member name="dbUser" value="'DB_USER'"/>
<member name="dbPasswd" value="'DB_PASSWD'"/>
<member name="dbName" value="'DB_NAME'"/>
<members name="DB_FIELDS" initPK="0"/>
<methods name="DB_FIELD_GETTER"/>
<methods name="DB_FIELD_SETTER"/>
<method name="__construct">
<arg name="value"/>
<description>Default constructor</description>
<description>@param value some value</description>
</method>
<method name="INIT_LOAD"/>
<method name="TO_STRING"/>
<method name="loadAll" static="true" visibility="public">
<body>
$OBJECT_NAME = new CLASS_NAME();
$rows = $OBJECT_NAME-&gt;dao-&gt;getData("");
$OBJECT_NAMEs = array();
for ($index = 0; $index &lt; sizeof($rows); $index++) {
$d = new Document();
$d-&gt;init($rows[$index]);
array_push($OBJECT_NAMEs,$d);
}
return $OBJECT_NAMEs;
</body>
</method>
<method name="LOAD_UNIQUE" static="true">
<body>
$OBJECT_NAME = new CLASS_NAME();
$rows = $OBJECT_NAME-&gt;dao-&gt;getData("PK_WHERE");
$OBJECT_NAME-&gt;init($rows[0]);
return $OBJECT_NAME;
</body>
</method>
<methods name="LOAD_BY_FK" static="true" visibility="public">
<body>
$OBJECT_NAME = new CLASS_NAME();
$rows = $OBJECT_NAME-&gt;dao-&gt;getData("FK_WHERE");
$OBJECT_NAMEs = array();
for ($index = 0; $index &lt; sizeof($rows); $index++) {
$d = new Document();
$d-&gt;init($rows[$index]);
array_push($OBJECT_NAMEs,$d);
}
return $OBJECT_NAMEs;
</body>
</methods>
<method name="INSERT" visibility="private">
<body>
$list = array(FIELD_ARRAY);
return $this-&gt;dao-&gt;insertRecord($list);
</body>
</method>
<method name="UPDATE" visibility="private">
<body>
$list = array(FIELD_ARRAY);
$where = "PK_WHERE";
return $this-&gt;dao-&gt;updateRecord($list,$where);
</body>
</method>
<method name="INIT_POST" visibility="private"/>
<method name="INIT_GET" visibility="private"/>
</phpClassTemplate>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.