summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2015-01-20 22:02:33 +0100
committerFabio Bas <ctrlaltca@gmail.com>2015-01-20 22:02:33 +0100
commit90b5141367db5fcac9ba72042278556612b5dc3f (patch)
tree369112fd85eab39d36f4726f4f763828e6c560a4 /framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php
parentf6c4b70070a8e4378a37f750d53920e44bcc5857 (diff)
One class per file: framework/Data
Diffstat (limited to 'framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php')
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php72
1 files changed, 72 insertions, 0 deletions
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php b/framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php
new file mode 100644
index 00000000..51299097
--- /dev/null
+++ b/framework/Data/SqlMap/Configuration/TSqlMapSelectKey.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * TSqlMapStatement, TSqlMapInsert, TSqlMapUpdate, TSqlMapDelete,
+ * TSqlMapSelect and TSqlMapSelectKey classes file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Data.SqlMap.Configuration
+ */
+
+/**
+ * TSqlMapSelect corresponds to the <selectKey> element.
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @package System.Data.SqlMap.Configuration
+ * @since 3.1
+ */
+class TSqlMapSelectKey extends TSqlMapStatement
+{
+ private $_type = 'post';
+ private $_property;
+
+ /**
+ * @return string select generated key type, 'post' or 'pre'.
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * @param string select generated key type, 'post' or 'pre'.
+ */
+ public function setType($value)
+ {
+ $this->_type = strtolower($value) == 'post' ? 'post' : 'pre';
+ }
+
+ /**
+ * @return string property name for the generated key.
+ */
+ public function getProperty()
+ {
+ return $this->_property;
+ }
+
+ /**
+ * @param string property name for the generated key.
+ */
+ public function setProperty($value)
+ {
+ $this->_property = $value;
+ }
+
+ /**
+ * @throws TSqlMapConfigurationException extends is unsupported.
+ */
+ public function setExtends($value)
+ {
+ throw new TSqlMapConfigurationException('sqlmap_can_not_extend_select_key');
+ }
+
+ /**
+ * @return boolean true if key is generated after insert command, false otherwise.
+ */
+ public function getIsAfter()
+ {
+ return $this->_type == 'post';
+ }
+} \ No newline at end of file