| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* IMappedStatement interface file.
|
|
|
4 |
*
|
|
|
5 |
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
|
|
|
6 |
* @version $Id: IMappedStatement.php 2541 2008-10-21 15:05:13Z qiang.xue $
|
|
|
7 |
* @package System.Data.SqlMap.Statements
|
|
|
8 |
*/
|
|
|
9 |
|
|
|
10 |
/**
|
|
|
11 |
* Interface for all mapping statements.
|
|
|
12 |
*
|
|
|
13 |
* @author Wei Zhuo <weizho[at]gmail[dot]com>
|
|
|
14 |
* @version $Id: IMappedStatement.php 2541 2008-10-21 15:05:13Z qiang.xue $
|
|
|
15 |
* @package System.Data.SqlMap.Statements
|
|
|
16 |
* @since 3.1
|
|
|
17 |
*/
|
|
|
18 |
interface IMappedStatement
|
|
|
19 |
{
|
|
|
20 |
/**
|
|
|
21 |
* @return string Name used to identify the MappedStatement amongst the others.
|
|
|
22 |
*/
|
|
|
23 |
public function getID();
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* @return TSqlMapStatement The SQL statment used by this TMappedStatement.
|
|
|
27 |
*/
|
|
|
28 |
public function getStatement();
|
|
|
29 |
|
|
|
30 |
/**
|
|
|
31 |
* @return TSqlMap The TSqlMap used by this TMappedStatement
|
|
|
32 |
*/
|
|
|
33 |
public function getManager();
|
|
|
34 |
|
|
|
35 |
/**
|
|
|
36 |
* Executes the SQL and retuns all rows selected in a map that is keyed on
|
|
|
37 |
* the property named in the <tt>$keyProperty</tt> parameter. The value at
|
|
|
38 |
* each key will be the value of the property specified in the
|
|
|
39 |
* <tt>$valueProperty</tt> parameter. If <tt>$valueProperty</tt> is
|
|
|
40 |
* <tt>null</tt>, the entire result object will be entered.
|
|
|
41 |
* @param IDbConnection database connection to execute the query
|
|
|
42 |
* @param mixed The object used to set the parameters in the SQL.
|
|
|
43 |
* @param string The property of the result object to be used as the key.
|
|
|
44 |
* @param string The property of the result object to be used as the value (or null)
|
|
|
45 |
* @return TMap A map of object containing the rows keyed by <tt>$keyProperty</tt>.
|
|
|
46 |
*/
|
|
|
47 |
public function executeQueryForMap($connection, $parameter, $keyProperty, $valueProperty=null);
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
/**
|
|
|
51 |
* Execute an update statement. Also used for delete statement. Return the
|
|
|
52 |
* number of row effected.
|
|
|
53 |
* @param IDbConnection database connection to execute the query
|
|
|
54 |
* @param mixed The object used to set the parameters in the SQL.
|
|
|
55 |
* @return integer The number of row effected.
|
|
|
56 |
*/
|
|
|
57 |
public function executeUpdate($connection, $parameter);
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
/**
|
|
|
61 |
* Executes the SQL and retuns a subset of the rows selected.
|
|
|
62 |
* @param IDbConnection database connection to execute the query
|
|
|
63 |
* @param mixed The object used to set the parameters in the SQL.
|
|
|
64 |
* @param TList A list to populate the result with.
|
|
|
65 |
* @param integer The number of rows to skip over.
|
|
|
66 |
* @param integer The maximum number of rows to return.
|
|
|
67 |
* @return TList A TList of result objects.
|
|
|
68 |
*/
|
|
|
69 |
public function executeQueryForList($connection, $parameter, $result=null, $skip=-1, $max=-1);
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* Executes an SQL statement that returns a single row as an object
|
|
|
74 |
* of the type of the <tt>$result</tt> passed in as a parameter.
|
|
|
75 |
* @param IDbConnection database connection to execute the query
|
|
|
76 |
* @param mixed The object used to set the parameters in the SQL.
|
|
|
77 |
* @param object The result object.
|
|
|
78 |
* @return object result.
|
|
|
79 |
*/
|
|
|
80 |
public function executeQueryForObject($connection,$parameter, $result=null);
|
|
|
81 |
}
|
|
|
82 |
|