Commit 409bb184 authored by Manfred Kutas's avatar Manfred Kutas

ZP-1002 replace tabs with spaces.

Released under the Affero GNU General Public License (AGPL) version 3.
parent c95a539e
...@@ -654,14 +654,14 @@ class SqlStateMachine implements IStateMachine { ...@@ -654,14 +654,14 @@ class SqlStateMachine implements IStateMachine {
* If the parameter is null then " IS NULL" is returned, else " = $key". * If the parameter is null then " IS NULL" is returned, else " = $key".
* *
* @param array& $params $params[$key] will be unset, if is_null($params[$key]) * @param array& $params $params[$key] will be unset, if is_null($params[$key])
* @param string $key eg. ":key" * @param string $key eg. ":key"
* *
* @access protected * @access protected
* @return string * @return string
*/ */
protected function getSQLOp(&$params, $key) { protected function getSQLOp(&$params, $key) {
if (is_null($params[$key])) { if (is_null($params[$key])) {
unset($params[$key]); unset($params[$key]);
return " IS NULL"; return " IS NULL";
} }
return " = $key"; return " = $key";
...@@ -712,11 +712,11 @@ class SqlStateMachine implements IStateMachine { ...@@ -712,11 +712,11 @@ class SqlStateMachine implements IStateMachine {
protected function getStateHashStatement(&$params, $key=':key') { protected function getStateHashStatement(&$params, $key=':key') {
if (!isset($this->stateHashStatement) || $this->stateHashStatement == null) { if (!isset($this->stateHashStatement) || $this->stateHashStatement == null) {
$sql = "SELECT updated_at FROM {$this->states_table} WHERE device_id = :devid AND state_type = :type AND uuid ". $this->getSQLOp($params, $key) ." AND counter = :counter"; $sql = "SELECT updated_at FROM {$this->states_table} WHERE device_id = :devid AND state_type = :type AND uuid ". $this->getSQLOp($params, $key) ." AND counter = :counter";
$this->stateHashStatement = $this->getDbh()->prepare($sql); $this->stateHashStatement = $this->getDbh()->prepare($sql);
}
else {
$this->getSQLOp($params, $key); // need to unset $params[':key'] for NULL
} }
else {
$this->getSQLOp($params, $key); // need to unset $params[':key'] for NULL
}
return $this->stateHashStatement; return $this->stateHashStatement;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment