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 setIsDateTime(bool $isDateTime): self { $this->dateTime = $isDateTime; return $this; } public function setTimeZone(?string $timeZone): self { $this->timeZone = $timeZone; 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, 'dateTime' => $this->dateTime, 'timeZone' => $this->timeZone, ]); } }