Skip to content

Commit 491ee41

Browse files
committed
Perf: Do not recreate Cell entity just for formatting value
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent a7c1b59 commit 491ee41

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

lib/Db/RowCellSuper.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,9 @@ public function __construct() {
3737
$this->addType('rowId', 'integer');
3838
}
3939

40-
/**
41-
* Same as Entity::fromRow but ignoring unknown properties
42-
*/
43-
public static function fromRowData(array $row): RowCellSuper {
44-
$instance = new static();
45-
46-
foreach ($row as $key => $value) {
47-
$property = $instance->columnToProperty($key);
48-
$setter = 'set' . ucfirst($property);
49-
;
50-
if (property_exists($instance, $property)) {
51-
$instance->$setter($value);
52-
}
53-
}
54-
55-
$instance->resetUpdatedFields();
56-
57-
return $instance;
58-
}
59-
6040
/**
6141
* @param float|null|string $value
62-
* @param int $value_type
42+
* @param int $valueType
6343
*/
6444
public function jsonSerializePreparation(string|float|null $value, int $valueType = 0): array {
6545
return [

0 commit comments

Comments
 (0)