| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* TParameterPropert class file.
|
|
|
4 |
*
|
|
|
5 |
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
|
|
|
6 |
* @link http://www.pradosoft.com/
|
|
|
7 |
* @copyright Copyright © 2005-2008 PradoSoft
|
|
|
8 |
* @license http://www.pradosoft.com/license/
|
|
|
9 |
* @version $Id: TParameterProperty.php 2541 2008-10-21 15:05:13Z qiang.xue $
|
|
|
10 |
* @package System.Data.SqlMap.Configuration
|
|
|
11 |
*/
|
|
|
12 |
|
|
|
13 |
/**
|
|
|
14 |
* TParameterProperty corresponds to the <property> tag and defines
|
|
|
15 |
* one object property for the <parameterMap>
|
|
|
16 |
*
|
|
|
17 |
* The {@link NullValue setNullValue()} attribute can be set to any valid
|
|
|
18 |
* value (based on property type). The {@link NullValue setNullValue()} attribute
|
|
|
19 |
* is used to specify an inbound null value replacement. What this means is
|
|
|
20 |
* that when the value is detected in the object property, a NULL will be written
|
|
|
21 |
* to the database (the opposite behavior of an inbound null value replacement).
|
|
|
22 |
* This allows you to use a magic null number in your application for types that
|
|
|
23 |
* do not support null values (such as int, double, float). When these types of
|
|
|
24 |
* properties contain a matching null value (for example, say, -9999), a NULL
|
|
|
25 |
* will be written to the database instead of the value.
|
|
|
26 |
*
|
|
|
27 |
* @author Wei Zhuo <weizho[at]gmail[dot]com>
|
|
|
28 |
* @version $Id: TParameterProperty.php 2541 2008-10-21 15:05:13Z qiang.xue $
|
|
|
29 |
* @package System.Data.SqlMap.Configuration
|
|
|
30 |
* @since 3.1
|
|
|
31 |
*/
|
|
|
32 |
class TParameterProperty extends TComponent
|
|
|
33 |
{
|
|
|
34 |
private $_typeHandler;
|
|
|
35 |
private $_type;
|
|
|
36 |
private $_column;
|
|
|
37 |
private $_dbType;
|
|
|
38 |
private $_property;
|
|
|
39 |
private $_nullValue;
|
|
|
40 |
|
|
|
41 |
/**
|
|
|
42 |
* @return string class name of a custom type handler.
|
|
|
43 |
*/
|
|
|
44 |
public function getTypeHandler()
|
|
|
45 |
{
|
|
|
46 |
return $this->_typeHandler;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* @param string class name of a custom type handler.
|
|
|
51 |
*/
|
|
|
52 |
public function setTypeHandler($value)
|
|
|
53 |
{
|
|
|
54 |
$this->_typeHandler = $value;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* @return string type of the parameter's property
|
|
|
59 |
*/
|
|
|
60 |
public function getType()
|
|
|
61 |
{
|
|
|
62 |
return $this->_type;
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
/**
|
|
|
66 |
* @param string type of the parameter's property
|
|
|
67 |
*/
|
|
|
68 |
public function setType($value)
|
|
|
69 |
{
|
|
|
70 |
$this->_type = $value;
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
/**
|
|
|
74 |
* @return string name of a parameter to be used in the SQL statement.
|
|
|
75 |
*/
|
|
|
76 |
public function getColumn()
|
|
|
77 |
{
|
|
|
78 |
return $this->_column;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
/**
|
|
|
82 |
* @param string name of a parameter to be used in the SQL statement.
|
|
|
83 |
*/
|
|
|
84 |
public function setColumn($value)
|
|
|
85 |
{
|
|
|
86 |
$this->_column = $value;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* @return string the database column type of the parameter to be set by this property.
|
|
|
91 |
*/
|
|
|
92 |
public function getDbType()
|
|
|
93 |
{
|
|
|
94 |
return $this->_dbType;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
/**
|
|
|
98 |
* @param string the database column type of the parameter to be set by this property.
|
|
|
99 |
*/
|
|
|
100 |
public function setDbType($value)
|
|
|
101 |
{
|
|
|
102 |
$this->_dbType = $value;
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
/**
|
|
|
106 |
* @return string name of a property of the parameter object.
|
|
|
107 |
*/
|
|
|
108 |
public function getProperty()
|
|
|
109 |
{
|
|
|
110 |
return $this->_property;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
/**
|
|
|
114 |
* @param string name of a property of the parameter object.
|
|
|
115 |
*/
|
|
|
116 |
public function setProperty($value)
|
|
|
117 |
{
|
|
|
118 |
$this->_property = $value;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
/**
|
|
|
122 |
* @return mixed null value replacement
|
|
|
123 |
*/
|
|
|
124 |
public function getNullValue()
|
|
|
125 |
{
|
|
|
126 |
return $this->_nullValue;
|
|
|
127 |
}
|
|
|
128 |
|
|
|
129 |
/**
|
|
|
130 |
* The nullValue attribute is used to specify an outgoing null value replacement.
|
|
|
131 |
* @param mixed null value replacement.
|
|
|
132 |
*/
|
|
|
133 |
public function setNullValue($value)
|
|
|
134 |
{
|
|
|
135 |
$this->_nullValue = $value;
|
|
|
136 |
}
|
|
|
137 |
}
|
|
|
138 |
|