Skip to content

Commit 469f532

Browse files
committed
refactor!: use fromDatabase() in Database Results
1 parent a967f50 commit 469f532

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

system/Database/MySQLi/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function fetchAssoc()
148148
protected function fetchObject(string $className = 'stdClass')
149149
{
150150
if (is_subclass_of($className, Entity::class)) {
151-
return empty($data = $this->fetchAssoc()) ? false : (new $className())->injectRawData($data);
151+
return empty($data = $this->fetchAssoc()) ? false : (new $className())->fromDatabase($data);
152152
}
153153

154154
return $this->resultID->fetch_object($className);

system/Database/OCI8/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function fetchObject(string $className = 'stdClass')
103103
return $row;
104104
}
105105
if (is_subclass_of($className, Entity::class)) {
106-
return (new $className())->injectRawData((array) $row);
106+
return (new $className())->fromDatabase((array) $row);
107107
}
108108

109109
$instance = new $className();

system/Database/Postgre/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function fetchAssoc()
114114
protected function fetchObject(string $className = 'stdClass')
115115
{
116116
if (is_subclass_of($className, Entity::class)) {
117-
return empty($data = $this->fetchAssoc()) ? false : (new $className())->injectRawData($data);
117+
return empty($data = $this->fetchAssoc()) ? false : (new $className())->fromDatabase($data);
118118
}
119119

120120
return pg_fetch_object($this->resultID, null, $className);

system/Database/SQLSRV/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function fetchAssoc()
154154
protected function fetchObject(string $className = 'stdClass')
155155
{
156156
if (is_subclass_of($className, Entity::class)) {
157-
return empty($data = $this->fetchAssoc()) ? false : (new $className())->injectRawData($data);
157+
return empty($data = $this->fetchAssoc()) ? false : (new $className())->fromDatabase($data);
158158
}
159159

160160
return sqlsrv_fetch_object($this->resultID, $className);

system/Database/SQLite3/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected function fetchObject(string $className = 'stdClass')
142142
$classObj = new $className();
143143

144144
if (is_subclass_of($className, Entity::class)) {
145-
return $classObj->injectRawData($row);
145+
return $classObj->fromDatabase($row);
146146
}
147147

148148
$classSet = Closure::bind(function ($key, $value) {

0 commit comments

Comments
 (0)