@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @throws TDBMException |
95 | 95 | * @throws TDBMInvalidOperationException |
96 | 96 | */ |
97 | - public function __construct(AbstractTDBMObject $object, $table_name, array $primaryKeys=array(), TDBMService $tdbmService=null, array $dbRow = array()) { |
|
97 | + public function __construct(AbstractTDBMObject $object, $table_name, array $primaryKeys = array(), TDBMService $tdbmService = null, array $dbRow = array()) { |
|
98 | 98 | $this->object = $object; |
99 | 99 | $this->dbTableName = $table_name; |
100 | 100 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * $status = TDBMObjectStateEnum::STATE_LOADED when the object is cached in memory. |
142 | 142 | * @param string $state |
143 | 143 | */ |
144 | - public function _setStatus($state){ |
|
144 | + public function _setStatus($state) { |
|
145 | 145 | $this->status = $state; |
146 | 146 | } |
147 | 147 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $sql = "SELECT * FROM ".$connection->quoteIdentifier($this->dbTableName)." WHERE ".$sql_where; |
164 | 164 | $result = $connection->executeQuery($sql, $parameters); |
165 | 165 | |
166 | - if ($result->rowCount()==0) |
|
166 | + if ($result->rowCount() == 0) |
|
167 | 167 | { |
168 | 168 | throw new TDBMException("Could not retrieve object from table \"$this->dbTableName\" with ID \"".$this->TDBMObject_id."\"."); |
169 | 169 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * Implement the unique JsonSerializable method |
311 | 311 | * @return array |
312 | 312 | */ |
313 | - public function jsonSerialize(){ |
|
313 | + public function jsonSerialize() { |
|
314 | 314 | $this->_dbLoadIfNotLoaded(); |
315 | 315 | return $this->dbRow; |
316 | 316 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | /** |
338 | 338 | * Override the native php clone function for TDBMObjects |
339 | 339 | */ |
340 | - public function __clone(){ |
|
340 | + public function __clone() { |
|
341 | 341 | $this->_dbLoadIfNotLoaded(); |
342 | 342 | //First lets set the status to new (to enter the save function) |
343 | 343 | $this->status = TDBMObjectStateEnum::STATE_NEW; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $pkValues = array_values($firstRefDbRow->_getPrimaryKeys()); |
370 | 370 | $localColumns = $fk->getLocalColumns(); |
371 | 371 | |
372 | - for ($i=0, $count=count($localColumns); $i<$count; $i++) { |
|
372 | + for ($i = 0, $count = count($localColumns); $i<$count; $i++) { |
|
373 | 373 | $dbRow[$localColumns[$i]] = $pkValues[$i]; |
374 | 374 | } |
375 | 375 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | |
78 | 78 | |
79 | 79 | private function toIndex($offset) { |
80 | - if ($offset < 0 || filter_var($offset, FILTER_VALIDATE_INT) === false) { |
|
80 | + if ($offset<0 || filter_var($offset, FILTER_VALIDATE_INT) === false) { |
|
81 | 81 | throw new TDBMInvalidOffsetException('Trying to access result set using offset "'.$offset.'". An offset must be a positive integer.'); |
82 | 82 | } |
83 | 83 | if ($this->statement === null) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | class TDBMObjectArray extends \ArrayObject implements \JsonSerializable { |
29 | 29 | public function __get($var) { |
30 | 30 | $cnt = count($this); |
31 | - if ($cnt==1) |
|
31 | + if ($cnt == 1) |
|
32 | 32 | { |
33 | 33 | return $this[0]->__get($var); |
34 | 34 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function __set($var, $value) { |
46 | 46 | $cnt = count($this); |
47 | - if ($cnt==1) |
|
47 | + if ($cnt == 1) |
|
48 | 48 | { |
49 | 49 | return $this[0]->__set($var, $value); |
50 | 50 | } |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function __call($func_name, $values) { |
71 | 71 | |
72 | - if (strpos($func_name,"getarray_") === 0) { |
|
72 | + if (strpos($func_name, "getarray_") === 0) { |
|
73 | 73 | $column = substr($func_name, 9); |
74 | 74 | return $this->getarray($column); |
75 | - } elseif (strpos($func_name,"setarray_") === 0) { |
|
75 | + } elseif (strpos($func_name, "setarray_") === 0) { |
|
76 | 76 | $column = substr($func_name, 9); |
77 | 77 | return $this->setarray($column, $values[0]); |
78 | - } elseif (count($this)==1) { |
|
78 | + } elseif (count($this) == 1) { |
|
79 | 79 | $this[0]->__call($func_name, $values); |
80 | 80 | } |
81 | 81 | else |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - public function jsonSerialize(){ |
|
102 | + public function jsonSerialize() { |
|
103 | 103 | return (array) $this; |
104 | 104 | } |
105 | 105 | } |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $columnName |
86 | 86 | * @param string $value |
87 | 87 | */ |
88 | - public function __construct($tableName=null, $columnName=null, $value=null) { |
|
88 | + public function __construct($tableName = null, $columnName = null, $value = null) { |
|
89 | 89 | $this->tableName = $tableName; |
90 | 90 | $this->columnName = $columnName; |
91 | 91 | $this->value = $value; |