summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Statements
diff options
context:
space:
mode:
authorgodzilla80@gmx.net <>2009-03-19 21:20:47 +0000
committergodzilla80@gmx.net <>2009-03-19 21:20:47 +0000
commitde021710e1c0dae732e61ecb42a9ac60440f55ee (patch)
treedffb0f86c8db116759087d2795470d1e2cda9c5f /framework/Data/SqlMap/Statements
parent798783263a8638675c0df2d1274fb1947ef79d1b (diff)
replace is_null() function calls with native native language constuct
Diffstat (limited to 'framework/Data/SqlMap/Statements')
-rw-r--r--framework/Data/SqlMap/Statements/TCachingStatement.php8
-rw-r--r--framework/Data/SqlMap/Statements/TMappedStatement.php34
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatementFactory.php4
3 files changed, 23 insertions, 23 deletions
diff --git a/framework/Data/SqlMap/Statements/TCachingStatement.php b/framework/Data/SqlMap/Statements/TCachingStatement.php
index c8a748c1..fcaeb974 100644
--- a/framework/Data/SqlMap/Statements/TCachingStatement.php
+++ b/framework/Data/SqlMap/Statements/TCachingStatement.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.SqlMap.Statements
@@ -47,7 +47,7 @@ class TCachingStatement implements IMappedStatement
$sql = $this->createCommand($connection, $parameter, $skip, $max);
$key = $this->getCacheKey(array(clone($sql), $keyProperty, $valueProperty,$skip, $max));
$map = $this->getStatement()->getCache()->get($key);
- if(is_null($map))
+ if($map===null)
{
$map = $this->_mappedStatement->runQueryForMap(
$connection, $parameter, $sql, $keyProperty, $valueProperty, $delegate);
@@ -71,7 +71,7 @@ class TCachingStatement implements IMappedStatement
$sql = $this->createCommand($connection, $parameter, $skip, $max);
$key = $this->getCacheKey(array(clone($sql), $parameter, $skip, $max));
$list = $this->getStatement()->getCache()->get($key);
- if(is_null($list))
+ if($list===null)
{
$list = $this->_mappedStatement->runQueryForList(
$connection, $parameter, $sql, $result, $delegate);
@@ -85,7 +85,7 @@ class TCachingStatement implements IMappedStatement
$sql = $this->createCommand($connection, $parameter);
$key = $this->getCacheKey(array(clone($sql), $parameter));
$object = $this->getStatement()->getCache()->get($key);
- if(is_null($object))
+ if($object===null)
{
$object = $this->_mappedStatement->runQueryForObject($connection, $sql, $result);
$this->getStatement()->getCache()->set($key, $object);
diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php
index 6a9130fe..6b11b107 100644
--- a/framework/Data/SqlMap/Statements/TMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TMappedStatement.php
@@ -231,7 +231,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
$connection->setActive(true);
$reader = $sql->query();
//$reader = $this->executeSQLQueryLimit($connection, $sql, $max, $skip);
- if(!is_null($delegate))
+ if($delegate!==null)
{
foreach($reader as $row)
{
@@ -304,14 +304,14 @@ class TMappedStatement extends TComponent implements IMappedStatement
//$recordSet = $this->executeSQLQuery($connection, $sql);
$connection->setActive(true);
$reader = $command->query();
- if(!is_null($delegate))
+ if($delegate!==null)
{
//while($row = $recordSet->fetchRow())
foreach($reader as $row)
{
$obj = $this->applyResultMap($row);
$key = TPropertyAccess::get($obj, $keyProperty);
- $value = is_null($valueProperty) ? $obj :
+ $value = ($valueProperty===null) ? $obj :
TPropertyAccess::get($obj, $valueProperty);
$param = new TResultSetMapItemParameter($key, $value, $parameter, $map);
$this->raiseRowDelegate($delegate, $param);
@@ -324,7 +324,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
{
$obj = $this->applyResultMap($row);
$key = TPropertyAccess::get($obj, $keyProperty);
- $map[$key] = is_null($valueProperty) ? $obj :
+ $map[$key] = ($valueProperty===null) ? $obj :
TPropertyAccess::get($obj, $valueProperty);
}
}
@@ -426,7 +426,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
// var_dump($command,$parameter);
$result = $command->execute();
- if(is_null($generatedKey))
+ if($generatedKey===null)
$generatedKey = $this->getPostGeneratedSelectKey($connection, $parameter);
$this->executePostSelect($connection);
@@ -445,7 +445,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
if($this->_statement instanceof TSqlMapInsert)
{
$selectKey = $this->_statement->getSelectKey();
- if(!is_null($selectKey) && !$selectKey->getIsAfter())
+ if(($selectKey!==null) && !$selectKey->getIsAfter())
return $this->executeSelectKey($connection, $parameter, $selectKey);
}
}
@@ -461,7 +461,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
if($this->_statement instanceof TSqlMapInsert)
{
$selectKey = $this->_statement->getSelectKey();
- if(!is_null($selectKey) && $selectKey->getIsAfter())
+ if(($selectKey!==null) && $selectKey->getIsAfter())
return $this->executeSelectKey($connection, $parameter, $selectKey);
}
}
@@ -575,7 +575,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
*/
protected function fillResultClass($resultClass, $row, $resultObject)
{
- if(is_null($resultObject))
+ if($resultObject===null)
{
$registry = $this->getManager()->getTypeHandlers();
$resultObject = $this->_statement->createInstanceOfResultClass($registry,$row);
@@ -643,7 +643,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
$registry = $this->getManager()->getTypeHandlers();
$resultMap = $resultMap->resolveSubMap($registry,$row);
- if(is_null($resultObject))
+ if($resultObject===null)
$resultObject = $resultMap->createInstanceOfResult($registry);
if(is_object($resultObject))
@@ -734,10 +734,10 @@ class TMappedStatement extends TComponent implements IMappedStatement
*/
protected function fillDefaultResultMap($resultMap, $row, $resultObject)
{
- if(is_null($resultObject))
+ if($resultObject===null)
$resultObject='';
- if(!is_null($resultMap))
+ if($resultMap!==null)
$result = $this->fillArrayResultMap($resultMap, $row, $resultObject);
else
$result = $row;
@@ -762,8 +762,8 @@ class TMappedStatement extends TComponent implements IMappedStatement
$registry=$this->getManager()->getTypeHandlers();
foreach($resultMap->getColumns() as $column)
{
- if(is_null($column->getType())
- && !is_null($resultObject) && !is_object($resultObject))
+ if(($column->getType()===null)
+ && ($resultObject!==null) && !is_object($resultObject))
$column->setType(gettype($resultObject));
$result[$column->getProperty()] = $column->getPropertyValue($registry,$row);
}
@@ -800,7 +800,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
{
$resultObject = $property->getPropertyValue($registry,$row);
}
- else if(strlen($select) == 0 && is_null($nested))
+ else if(strlen($select) == 0 && ($nested===null))
{
$value = $property->getPropertyValue($registry,$row);
@@ -810,7 +810,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
else
$resultObject = $value;
}
- else if(!is_null($nested))
+ else if($nested!==null)
{
if($property->instanceOfListType($resultObject) || $property->instanceOfArrayType($resultObject))
{
@@ -995,8 +995,8 @@ class TSqlMapObjectCollectionTree
*/
public function add($parent, $node, $object='')
{
- if(isset($this->_entries[$parent]) && !is_null($this->_entries[$parent])
- && isset($this->_entries[$node]) && !is_null($this->_entries[$node]))
+ if(isset($this->_entries[$parent]) && ($this->_entries[$parent]!==null)
+ && isset($this->_entries[$node]) && ($this->_entries[$node]!==null))
{
$this->_entries[$node] = $object;
return;
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
index 44603408..a2a9df03 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.SqlMap.Statements
@@ -35,7 +35,7 @@ class TPreparedStatementFactory
{
$this->_preparedStatement = new TPreparedStatement();
$this->_preparedStatement->setPreparedSql($this->_commandText);
- if(!is_null($this->_statement->parameterMap()))
+ if($this->_statement->parameterMap()!==null)
$this->createParametersForTextCommand();
return $this->_preparedStatement;
}