eee
This commit is contained in:
@@ -13,7 +13,6 @@ namespace Database\Base;
|
||||
use ArrayIterator;
|
||||
use Database\ActiveQuery;
|
||||
use Database\ModelInterface;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Kiri\Abstracts\Component;
|
||||
use ReturnTypeWillChange;
|
||||
@@ -29,41 +28,29 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
/**
|
||||
* @var ModelInterface[]
|
||||
*/
|
||||
protected array $_item = [];
|
||||
private array $_item;
|
||||
|
||||
|
||||
/**
|
||||
* @var ModelInterface|string|null
|
||||
* @return array
|
||||
*/
|
||||
protected ModelInterface|string|null $model;
|
||||
|
||||
|
||||
/**
|
||||
* @var ActiveQuery
|
||||
*/
|
||||
protected ActiveQuery $query;
|
||||
|
||||
|
||||
public function clean(): void
|
||||
public function getItems(): array
|
||||
{
|
||||
unset($this->query, $this->model, $this->_item);
|
||||
// TODO: Change the autogenerated stub
|
||||
return $this->_item;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Collection constructor.
|
||||
*
|
||||
* @param $query
|
||||
* @param ActiveQuery $query
|
||||
* @param array $array
|
||||
* @param ModelInterface|null $model
|
||||
* @throws
|
||||
*/
|
||||
public function __construct($query, array $array = [], ModelInterface $model = null)
|
||||
public function __construct(public ActiveQuery $query, public ?ModelInterface $model = null, array $array = [])
|
||||
{
|
||||
$this->_item = $array;
|
||||
$this->query = $query;
|
||||
$this->model = $model;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user