Skip to content

Commit 45c7501

Browse files
committed
Rename method Entity::setRawArray() to Entity::setAttributes()
Signed-off-by: Andrey Pyzhikov <5071@mail.ru>
1 parent 8a9b67b commit 45c7501

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

system/Database/MySQLi/Result.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ protected function fetchObject(string $className = 'stdClass')
163163
{
164164
if (is_subclass_of($className, Entity::class))
165165
{
166-
$data = $this->fetchAssoc();
167-
return empty($data) ? false : (new $className())->setRawArray($data);
166+
return empty($data = $this->fetchAssoc()) ? false : (new $className())->setAttributes($data);
168167
}
169168
return $this->resultID->fetch_object($className);
170169
}

system/Database/Postgre/Result.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ protected function fetchObject(string $className = 'stdClass')
161161
{
162162
if (is_subclass_of($className, Entity::class))
163163
{
164-
$data = $this->fetchAssoc();
165-
return empty($data) ? false : (new $className())->setRawArray($data);
164+
return empty($data = $this->fetchAssoc()) ? false : (new $className())->setAttributes($data);
166165
}
167166
return pg_fetch_object($this->resultID, null, $className);
168167
}

system/Database/SQLite3/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ protected function fetchObject(string $className = 'stdClass')
186186

187187
if (is_subclass_of($className, Entity::class))
188188
{
189-
return $classObj->setRawArray($row);
189+
return $classObj->setAttributes($row);
190190
}
191191

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

system/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public function __isset(string $key): bool
433433
* @param array $data
434434
* @return $this
435435
*/
436-
public function setRawArray(array $data)
436+
public function setAttributes(array $data)
437437
{
438438
$this->attributes = $data;
439439
$this->syncOriginal();

0 commit comments

Comments
 (0)