Passed
Push — master ( e5ba7e...db7353 )
by Daniel
15:01 queued 13s
created
lib/public/AppFramework/Db/QBMapper.php 2 patches
Indentation   +317 added lines, -317 removed lines patch added patch discarded remove patch
@@ -43,321 +43,321 @@
 block discarded – undo
43 43
  * @template T of Entity
44 44
  */
45 45
 abstract class QBMapper {
46
-	/** @var string */
47
-	protected $tableName;
48
-
49
-	/** @var string|class-string<T> */
50
-	protected $entityClass;
51
-
52
-	/** @var IDBConnection */
53
-	protected $db;
54
-
55
-	/**
56
-	 * @param IDBConnection $db Instance of the Db abstraction layer
57
-	 * @param string $tableName the name of the table. set this to allow entity
58
-	 * @param class-string<T>|null $entityClass the name of the entity that the sql should be
59
-	 * mapped to queries without using sql
60
-	 * @since 14.0.0
61
-	 */
62
-	public function __construct(IDBConnection $db, string $tableName, string $entityClass = null) {
63
-		$this->db = $db;
64
-		$this->tableName = $tableName;
65
-
66
-		// if not given set the entity name to the class without the mapper part
67
-		// cache it here for later use since reflection is slow
68
-		if ($entityClass === null) {
69
-			$this->entityClass = str_replace('Mapper', '', \get_class($this));
70
-		} else {
71
-			$this->entityClass = $entityClass;
72
-		}
73
-	}
74
-
75
-
76
-	/**
77
-	 * @return string the table name
78
-	 * @since 14.0.0
79
-	 */
80
-	public function getTableName(): string {
81
-		return $this->tableName;
82
-	}
83
-
84
-
85
-	/**
86
-	 * Deletes an entity from the table
87
-	 *
88
-	 * @param Entity $entity the entity that should be deleted
89
-	 * @psalm-param T $entity the entity that should be deleted
90
-	 * @return Entity the deleted entity
91
-	 * @psalm-return T the deleted entity
92
-	 * @throws Exception
93
-	 * @since 14.0.0
94
-	 */
95
-	public function delete(Entity $entity): Entity {
96
-		$qb = $this->db->getQueryBuilder();
97
-
98
-		$idType = $this->getParameterTypeForProperty($entity, 'id');
99
-
100
-		$qb->delete($this->tableName)
101
-			->where(
102
-				$qb->expr()->eq('id', $qb->createNamedParameter($entity->getId(), $idType))
103
-			);
104
-		$qb->executeStatement();
105
-		return $entity;
106
-	}
107
-
108
-
109
-	/**
110
-	 * Creates a new entry in the db from an entity
111
-	 *
112
-	 * @param Entity $entity the entity that should be created
113
-	 * @psalm-param T $entity the entity that should be created
114
-	 * @return Entity the saved entity with the set id
115
-	 * @psalm-return T the saved entity with the set id
116
-	 * @throws Exception
117
-	 * @since 14.0.0
118
-	 */
119
-	public function insert(Entity $entity): Entity {
120
-		// get updated fields to save, fields have to be set using a setter to
121
-		// be saved
122
-		$properties = $entity->getUpdatedFields();
123
-
124
-		$qb = $this->db->getQueryBuilder();
125
-		$qb->insert($this->tableName);
126
-
127
-		// build the fields
128
-		foreach ($properties as $property => $updated) {
129
-			$column = $entity->propertyToColumn($property);
130
-			$getter = 'get' . ucfirst($property);
131
-			$value = $entity->$getter();
132
-
133
-			$type = $this->getParameterTypeForProperty($entity, $property);
134
-			$qb->setValue($column, $qb->createNamedParameter($value, $type));
135
-		}
136
-
137
-		$qb->executeStatement();
138
-
139
-		if ($entity->id === null) {
140
-			// When autoincrement is used id is always an int
141
-			$entity->setId($qb->getLastInsertId());
142
-		}
143
-
144
-		return $entity;
145
-	}
146
-
147
-	/**
148
-	 * Tries to creates a new entry in the db from an entity and
149
-	 * updates an existing entry if duplicate keys are detected
150
-	 * by the database
151
-	 *
152
-	 * @param Entity $entity the entity that should be created/updated
153
-	 * @psalm-param T $entity the entity that should be created/updated
154
-	 * @return Entity the saved entity with the (new) id
155
-	 * @psalm-return T the saved entity with the (new) id
156
-	 * @throws Exception
157
-	 * @throws \InvalidArgumentException if entity has no id
158
-	 * @since 15.0.0
159
-	 */
160
-	public function insertOrUpdate(Entity $entity): Entity {
161
-		try {
162
-			return $this->insert($entity);
163
-		} catch (Exception $ex) {
164
-			if ($ex->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
165
-				return $this->update($entity);
166
-			}
167
-			throw $ex;
168
-		}
169
-	}
170
-
171
-	/**
172
-	 * Updates an entry in the db from an entity
173
-	 *
174
-	 * @param Entity $entity the entity that should be created
175
-	 * @psalm-param T $entity the entity that should be created
176
-	 * @return Entity the saved entity with the set id
177
-	 * @psalm-return T the saved entity with the set id
178
-	 * @throws Exception
179
-	 * @throws \InvalidArgumentException if entity has no id
180
-	 * @since 14.0.0
181
-	 */
182
-	public function update(Entity $entity): Entity {
183
-		// if entity wasn't changed it makes no sense to run a db query
184
-		$properties = $entity->getUpdatedFields();
185
-		if (\count($properties) === 0) {
186
-			return $entity;
187
-		}
188
-
189
-		// entity needs an id
190
-		$id = $entity->getId();
191
-		if ($id === null) {
192
-			throw new \InvalidArgumentException(
193
-				'Entity which should be updated has no id');
194
-		}
195
-
196
-		// get updated fields to save, fields have to be set using a setter to
197
-		// be saved
198
-		// do not update the id field
199
-		unset($properties['id']);
200
-
201
-		$qb = $this->db->getQueryBuilder();
202
-		$qb->update($this->tableName);
203
-
204
-		// build the fields
205
-		foreach ($properties as $property => $updated) {
206
-			$column = $entity->propertyToColumn($property);
207
-			$getter = 'get' . ucfirst($property);
208
-			$value = $entity->$getter();
209
-
210
-			$type = $this->getParameterTypeForProperty($entity, $property);
211
-			$qb->set($column, $qb->createNamedParameter($value, $type));
212
-		}
213
-
214
-		$idType = $this->getParameterTypeForProperty($entity, 'id');
215
-
216
-		$qb->where(
217
-			$qb->expr()->eq('id', $qb->createNamedParameter($id, $idType))
218
-		);
219
-		$qb->executeStatement();
220
-
221
-		return $entity;
222
-	}
223
-
224
-	/**
225
-	 * Returns the type parameter for the QueryBuilder for a specific property
226
-	 * of the $entity
227
-	 *
228
-	 * @param Entity $entity   The entity to get the types from
229
-	 * @psalm-param T $entity
230
-	 * @param string $property The property of $entity to get the type for
231
-	 * @return int|string
232
-	 * @since 16.0.0
233
-	 */
234
-	protected function getParameterTypeForProperty(Entity $entity, string $property) {
235
-		$types = $entity->getFieldTypes();
236
-
237
-		if (!isset($types[ $property ])) {
238
-			return IQueryBuilder::PARAM_STR;
239
-		}
240
-
241
-		switch ($types[ $property ]) {
242
-			case 'int':
243
-			case 'integer':
244
-				return IQueryBuilder::PARAM_INT;
245
-			case 'string':
246
-				return IQueryBuilder::PARAM_STR;
247
-			case 'bool':
248
-			case 'boolean':
249
-				return IQueryBuilder::PARAM_BOOL;
250
-			case 'blob':
251
-				return IQueryBuilder::PARAM_LOB;
252
-			case 'datetime':
253
-				return IQueryBuilder::PARAM_DATE;
254
-			case 'json':
255
-				return IQueryBuilder::PARAM_JSON;
256
-		}
257
-
258
-		return IQueryBuilder::PARAM_STR;
259
-	}
260
-
261
-	/**
262
-	 * Returns an db result and throws exceptions when there are more or less
263
-	 * results
264
-	 *
265
-	 * @param IQueryBuilder $query
266
-	 * @return array the result as row
267
-	 * @throws Exception
268
-	 * @throws MultipleObjectsReturnedException if more than one item exist
269
-	 * @throws DoesNotExistException if the item does not exist
270
-	 * @see findEntity
271
-	 *
272
-	 * @since 14.0.0
273
-	 */
274
-	protected function findOneQuery(IQueryBuilder $query): array {
275
-		$result = $query->executeQuery();
276
-
277
-		$row = $result->fetch();
278
-		if ($row === false) {
279
-			$result->closeCursor();
280
-			$msg = $this->buildDebugMessage(
281
-				'Did expect one result but found none when executing', $query
282
-			);
283
-			throw new DoesNotExistException($msg);
284
-		}
285
-
286
-		$row2 = $result->fetch();
287
-		$result->closeCursor();
288
-		if ($row2 !== false) {
289
-			$msg = $this->buildDebugMessage(
290
-				'Did not expect more than one result when executing', $query
291
-			);
292
-			throw new MultipleObjectsReturnedException($msg);
293
-		}
294
-
295
-		return $row;
296
-	}
297
-
298
-	/**
299
-	 * @param string $msg
300
-	 * @param IQueryBuilder $sql
301
-	 * @return string
302
-	 * @since 14.0.0
303
-	 */
304
-	private function buildDebugMessage(string $msg, IQueryBuilder $sql): string {
305
-		return $msg .
306
-			': query "' . $sql->getSQL() . '"; ';
307
-	}
308
-
309
-
310
-	/**
311
-	 * Creates an entity from a row. Automatically determines the entity class
312
-	 * from the current mapper name (MyEntityMapper -> MyEntity)
313
-	 *
314
-	 * @param array $row the row which should be converted to an entity
315
-	 * @return Entity the entity
316
-	 * @psalm-return T the entity
317
-	 * @since 14.0.0
318
-	 */
319
-	protected function mapRowToEntity(array $row): Entity {
320
-		unset($row['DOCTRINE_ROWNUM']); // remove doctrine/dbal helper column
321
-		return \call_user_func($this->entityClass .'::fromRow', $row);
322
-	}
323
-
324
-
325
-	/**
326
-	 * Runs a sql query and returns an array of entities
327
-	 *
328
-	 * @param IQueryBuilder $query
329
-	 * @return Entity[] all fetched entities
330
-	 * @psalm-return T[] all fetched entities
331
-	 * @throws Exception
332
-	 * @since 14.0.0
333
-	 */
334
-	protected function findEntities(IQueryBuilder $query): array {
335
-		$result = $query->executeQuery();
336
-		try {
337
-			$entities = [];
338
-			while ($row = $result->fetch()) {
339
-				$entities[] = $this->mapRowToEntity($row);
340
-			}
341
-			return $entities;
342
-		} finally {
343
-			$result->closeCursor();
344
-		}
345
-	}
346
-
347
-
348
-	/**
349
-	 * Returns an db result and throws exceptions when there are more or less
350
-	 * results
351
-	 *
352
-	 * @param IQueryBuilder $query
353
-	 * @return Entity the entity
354
-	 * @psalm-return T the entity
355
-	 * @throws Exception
356
-	 * @throws MultipleObjectsReturnedException if more than one item exist
357
-	 * @throws DoesNotExistException if the item does not exist
358
-	 * @since 14.0.0
359
-	 */
360
-	protected function findEntity(IQueryBuilder $query): Entity {
361
-		return $this->mapRowToEntity($this->findOneQuery($query));
362
-	}
46
+    /** @var string */
47
+    protected $tableName;
48
+
49
+    /** @var string|class-string<T> */
50
+    protected $entityClass;
51
+
52
+    /** @var IDBConnection */
53
+    protected $db;
54
+
55
+    /**
56
+     * @param IDBConnection $db Instance of the Db abstraction layer
57
+     * @param string $tableName the name of the table. set this to allow entity
58
+     * @param class-string<T>|null $entityClass the name of the entity that the sql should be
59
+     * mapped to queries without using sql
60
+     * @since 14.0.0
61
+     */
62
+    public function __construct(IDBConnection $db, string $tableName, string $entityClass = null) {
63
+        $this->db = $db;
64
+        $this->tableName = $tableName;
65
+
66
+        // if not given set the entity name to the class without the mapper part
67
+        // cache it here for later use since reflection is slow
68
+        if ($entityClass === null) {
69
+            $this->entityClass = str_replace('Mapper', '', \get_class($this));
70
+        } else {
71
+            $this->entityClass = $entityClass;
72
+        }
73
+    }
74
+
75
+
76
+    /**
77
+     * @return string the table name
78
+     * @since 14.0.0
79
+     */
80
+    public function getTableName(): string {
81
+        return $this->tableName;
82
+    }
83
+
84
+
85
+    /**
86
+     * Deletes an entity from the table
87
+     *
88
+     * @param Entity $entity the entity that should be deleted
89
+     * @psalm-param T $entity the entity that should be deleted
90
+     * @return Entity the deleted entity
91
+     * @psalm-return T the deleted entity
92
+     * @throws Exception
93
+     * @since 14.0.0
94
+     */
95
+    public function delete(Entity $entity): Entity {
96
+        $qb = $this->db->getQueryBuilder();
97
+
98
+        $idType = $this->getParameterTypeForProperty($entity, 'id');
99
+
100
+        $qb->delete($this->tableName)
101
+            ->where(
102
+                $qb->expr()->eq('id', $qb->createNamedParameter($entity->getId(), $idType))
103
+            );
104
+        $qb->executeStatement();
105
+        return $entity;
106
+    }
107
+
108
+
109
+    /**
110
+     * Creates a new entry in the db from an entity
111
+     *
112
+     * @param Entity $entity the entity that should be created
113
+     * @psalm-param T $entity the entity that should be created
114
+     * @return Entity the saved entity with the set id
115
+     * @psalm-return T the saved entity with the set id
116
+     * @throws Exception
117
+     * @since 14.0.0
118
+     */
119
+    public function insert(Entity $entity): Entity {
120
+        // get updated fields to save, fields have to be set using a setter to
121
+        // be saved
122
+        $properties = $entity->getUpdatedFields();
123
+
124
+        $qb = $this->db->getQueryBuilder();
125
+        $qb->insert($this->tableName);
126
+
127
+        // build the fields
128
+        foreach ($properties as $property => $updated) {
129
+            $column = $entity->propertyToColumn($property);
130
+            $getter = 'get' . ucfirst($property);
131
+            $value = $entity->$getter();
132
+
133
+            $type = $this->getParameterTypeForProperty($entity, $property);
134
+            $qb->setValue($column, $qb->createNamedParameter($value, $type));
135
+        }
136
+
137
+        $qb->executeStatement();
138
+
139
+        if ($entity->id === null) {
140
+            // When autoincrement is used id is always an int
141
+            $entity->setId($qb->getLastInsertId());
142
+        }
143
+
144
+        return $entity;
145
+    }
146
+
147
+    /**
148
+     * Tries to creates a new entry in the db from an entity and
149
+     * updates an existing entry if duplicate keys are detected
150
+     * by the database
151
+     *
152
+     * @param Entity $entity the entity that should be created/updated
153
+     * @psalm-param T $entity the entity that should be created/updated
154
+     * @return Entity the saved entity with the (new) id
155
+     * @psalm-return T the saved entity with the (new) id
156
+     * @throws Exception
157
+     * @throws \InvalidArgumentException if entity has no id
158
+     * @since 15.0.0
159
+     */
160
+    public function insertOrUpdate(Entity $entity): Entity {
161
+        try {
162
+            return $this->insert($entity);
163
+        } catch (Exception $ex) {
164
+            if ($ex->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
165
+                return $this->update($entity);
166
+            }
167
+            throw $ex;
168
+        }
169
+    }
170
+
171
+    /**
172
+     * Updates an entry in the db from an entity
173
+     *
174
+     * @param Entity $entity the entity that should be created
175
+     * @psalm-param T $entity the entity that should be created
176
+     * @return Entity the saved entity with the set id
177
+     * @psalm-return T the saved entity with the set id
178
+     * @throws Exception
179
+     * @throws \InvalidArgumentException if entity has no id
180
+     * @since 14.0.0
181
+     */
182
+    public function update(Entity $entity): Entity {
183
+        // if entity wasn't changed it makes no sense to run a db query
184
+        $properties = $entity->getUpdatedFields();
185
+        if (\count($properties) === 0) {
186
+            return $entity;
187
+        }
188
+
189
+        // entity needs an id
190
+        $id = $entity->getId();
191
+        if ($id === null) {
192
+            throw new \InvalidArgumentException(
193
+                'Entity which should be updated has no id');
194
+        }
195
+
196
+        // get updated fields to save, fields have to be set using a setter to
197
+        // be saved
198
+        // do not update the id field
199
+        unset($properties['id']);
200
+
201
+        $qb = $this->db->getQueryBuilder();
202
+        $qb->update($this->tableName);
203
+
204
+        // build the fields
205
+        foreach ($properties as $property => $updated) {
206
+            $column = $entity->propertyToColumn($property);
207
+            $getter = 'get' . ucfirst($property);
208
+            $value = $entity->$getter();
209
+
210
+            $type = $this->getParameterTypeForProperty($entity, $property);
211
+            $qb->set($column, $qb->createNamedParameter($value, $type));
212
+        }
213
+
214
+        $idType = $this->getParameterTypeForProperty($entity, 'id');
215
+
216
+        $qb->where(
217
+            $qb->expr()->eq('id', $qb->createNamedParameter($id, $idType))
218
+        );
219
+        $qb->executeStatement();
220
+
221
+        return $entity;
222
+    }
223
+
224
+    /**
225
+     * Returns the type parameter for the QueryBuilder for a specific property
226
+     * of the $entity
227
+     *
228
+     * @param Entity $entity   The entity to get the types from
229
+     * @psalm-param T $entity
230
+     * @param string $property The property of $entity to get the type for
231
+     * @return int|string
232
+     * @since 16.0.0
233
+     */
234
+    protected function getParameterTypeForProperty(Entity $entity, string $property) {
235
+        $types = $entity->getFieldTypes();
236
+
237
+        if (!isset($types[ $property ])) {
238
+            return IQueryBuilder::PARAM_STR;
239
+        }
240
+
241
+        switch ($types[ $property ]) {
242
+            case 'int':
243
+            case 'integer':
244
+                return IQueryBuilder::PARAM_INT;
245
+            case 'string':
246
+                return IQueryBuilder::PARAM_STR;
247
+            case 'bool':
248
+            case 'boolean':
249
+                return IQueryBuilder::PARAM_BOOL;
250
+            case 'blob':
251
+                return IQueryBuilder::PARAM_LOB;
252
+            case 'datetime':
253
+                return IQueryBuilder::PARAM_DATE;
254
+            case 'json':
255
+                return IQueryBuilder::PARAM_JSON;
256
+        }
257
+
258
+        return IQueryBuilder::PARAM_STR;
259
+    }
260
+
261
+    /**
262
+     * Returns an db result and throws exceptions when there are more or less
263
+     * results
264
+     *
265
+     * @param IQueryBuilder $query
266
+     * @return array the result as row
267
+     * @throws Exception
268
+     * @throws MultipleObjectsReturnedException if more than one item exist
269
+     * @throws DoesNotExistException if the item does not exist
270
+     * @see findEntity
271
+     *
272
+     * @since 14.0.0
273
+     */
274
+    protected function findOneQuery(IQueryBuilder $query): array {
275
+        $result = $query->executeQuery();
276
+
277
+        $row = $result->fetch();
278
+        if ($row === false) {
279
+            $result->closeCursor();
280
+            $msg = $this->buildDebugMessage(
281
+                'Did expect one result but found none when executing', $query
282
+            );
283
+            throw new DoesNotExistException($msg);
284
+        }
285
+
286
+        $row2 = $result->fetch();
287
+        $result->closeCursor();
288
+        if ($row2 !== false) {
289
+            $msg = $this->buildDebugMessage(
290
+                'Did not expect more than one result when executing', $query
291
+            );
292
+            throw new MultipleObjectsReturnedException($msg);
293
+        }
294
+
295
+        return $row;
296
+    }
297
+
298
+    /**
299
+     * @param string $msg
300
+     * @param IQueryBuilder $sql
301
+     * @return string
302
+     * @since 14.0.0
303
+     */
304
+    private function buildDebugMessage(string $msg, IQueryBuilder $sql): string {
305
+        return $msg .
306
+            ': query "' . $sql->getSQL() . '"; ';
307
+    }
308
+
309
+
310
+    /**
311
+     * Creates an entity from a row. Automatically determines the entity class
312
+     * from the current mapper name (MyEntityMapper -> MyEntity)
313
+     *
314
+     * @param array $row the row which should be converted to an entity
315
+     * @return Entity the entity
316
+     * @psalm-return T the entity
317
+     * @since 14.0.0
318
+     */
319
+    protected function mapRowToEntity(array $row): Entity {
320
+        unset($row['DOCTRINE_ROWNUM']); // remove doctrine/dbal helper column
321
+        return \call_user_func($this->entityClass .'::fromRow', $row);
322
+    }
323
+
324
+
325
+    /**
326
+     * Runs a sql query and returns an array of entities
327
+     *
328
+     * @param IQueryBuilder $query
329
+     * @return Entity[] all fetched entities
330
+     * @psalm-return T[] all fetched entities
331
+     * @throws Exception
332
+     * @since 14.0.0
333
+     */
334
+    protected function findEntities(IQueryBuilder $query): array {
335
+        $result = $query->executeQuery();
336
+        try {
337
+            $entities = [];
338
+            while ($row = $result->fetch()) {
339
+                $entities[] = $this->mapRowToEntity($row);
340
+            }
341
+            return $entities;
342
+        } finally {
343
+            $result->closeCursor();
344
+        }
345
+    }
346
+
347
+
348
+    /**
349
+     * Returns an db result and throws exceptions when there are more or less
350
+     * results
351
+     *
352
+     * @param IQueryBuilder $query
353
+     * @return Entity the entity
354
+     * @psalm-return T the entity
355
+     * @throws Exception
356
+     * @throws MultipleObjectsReturnedException if more than one item exist
357
+     * @throws DoesNotExistException if the item does not exist
358
+     * @since 14.0.0
359
+     */
360
+    protected function findEntity(IQueryBuilder $query): Entity {
361
+        return $this->mapRowToEntity($this->findOneQuery($query));
362
+    }
363 363
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		// build the fields
128 128
 		foreach ($properties as $property => $updated) {
129 129
 			$column = $entity->propertyToColumn($property);
130
-			$getter = 'get' . ucfirst($property);
130
+			$getter = 'get'.ucfirst($property);
131 131
 			$value = $entity->$getter();
132 132
 
133 133
 			$type = $this->getParameterTypeForProperty($entity, $property);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		// build the fields
205 205
 		foreach ($properties as $property => $updated) {
206 206
 			$column = $entity->propertyToColumn($property);
207
-			$getter = 'get' . ucfirst($property);
207
+			$getter = 'get'.ucfirst($property);
208 208
 			$value = $entity->$getter();
209 209
 
210 210
 			$type = $this->getParameterTypeForProperty($entity, $property);
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 	protected function getParameterTypeForProperty(Entity $entity, string $property) {
235 235
 		$types = $entity->getFieldTypes();
236 236
 
237
-		if (!isset($types[ $property ])) {
237
+		if (!isset($types[$property])) {
238 238
 			return IQueryBuilder::PARAM_STR;
239 239
 		}
240 240
 
241
-		switch ($types[ $property ]) {
241
+		switch ($types[$property]) {
242 242
 			case 'int':
243 243
 			case 'integer':
244 244
 				return IQueryBuilder::PARAM_INT;
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
 	 * @since 14.0.0
303 303
 	 */
304 304
 	private function buildDebugMessage(string $msg, IQueryBuilder $sql): string {
305
-		return $msg .
306
-			': query "' . $sql->getSQL() . '"; ';
305
+		return $msg.
306
+			': query "'.$sql->getSQL().'"; ';
307 307
 	}
308 308
 
309 309
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	protected function mapRowToEntity(array $row): Entity {
320 320
 		unset($row['DOCTRINE_ROWNUM']); // remove doctrine/dbal helper column
321
-		return \call_user_func($this->entityClass .'::fromRow', $row);
321
+		return \call_user_func($this->entityClass.'::fromRow', $row);
322 322
 	}
323 323
 
324 324
 
Please login to merge, or discard this patch.