This commit is contained in:
xl
2023-11-13 17:52:38 +08:00
parent dcf4e0a614
commit a1238613f9
3 changed files with 3 additions and 5 deletions
+1 -2
View File
@@ -17,14 +17,13 @@ use Exception;
use JetBrains\PhpStorm\Pure; use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Component; use Kiri\Abstracts\Component;
use ReturnTypeWillChange; use ReturnTypeWillChange;
use Kiri\ToArray;
use Traversable; use Traversable;
/** /**
* Class AbstractCollection * Class AbstractCollection
* @package Database\Base * @package Database\Base
*/ */
abstract class AbstractCollection extends Component implements \IteratorAggregate, \ArrayAccess, ToArray abstract class AbstractCollection extends Component implements \IteratorAggregate, \ArrayAccess, \Arrayable
{ {
/** /**
+1 -2
View File
@@ -25,7 +25,6 @@ use Exception;
use Kiri; use Kiri;
use Kiri\Abstracts\Component; use Kiri\Abstracts\Component;
use ReturnTypeWillChange; use ReturnTypeWillChange;
use Kiri\ToArray;
use ReflectionException; use ReflectionException;
use validator\Validator; use validator\Validator;
@@ -38,7 +37,7 @@ use validator\Validator;
* @property array $attributes * @property array $attributes
* @property array $oldAttributes * @property array $oldAttributes
*/ */
abstract class Model extends Component implements ModelInterface, ArrayAccess, ToArray abstract class Model extends Component implements ModelInterface, ArrayAccess, \Arrayable
{ {
/** @var array */ /** @var array */
+1 -1
View File
@@ -273,7 +273,7 @@ class Model extends Base\Model
$with = $this->getWith(); $with = $this->getWith();
foreach ($with as $value) { foreach ($with as $value) {
$join = $this->withRelate($value); $join = $this->withRelate($value);
if ($join instanceof Kiri\ToArray) { if ($join instanceof \Arrayable) {
$join = $join->toArray(); $join = $join->toArray();
} }
$data[$value] = $join; $data[$value] = $join;