type = $type; return $this; } /** * @param mixed $value */ public function setValue($value): self { $this->value = $value; return $this; } public function setAttribute(?string $attribute): self { $this->attribute = $attribute; return $this; } public function setData(?Data $data): self { $this->data = $data; return $this; } /** * Set nested where item list. * * @param Item[] $itemList * @return self */ public function setItemList(array $itemList): self { $this->value = array_map( function (Item $item): array { return $item->getRaw(); }, $itemList ); return $this; } public function build(): Item { return Item ::fromRaw([ 'type' => $this->type, 'attribute' => $this->attribute, 'value' => $this->value, ]) ->withData($this->data); } }