items->isEmpty(); } /** * 장바구니 아이템 수 조회 * * @return int 아이템 수 */ public function count(): int { return $this->items->count(); } /** * 배열로 변환 * * @return array */ public function toArray(): array { return [ 'items' => $this->items->toArray(), 'calculation' => $this->calculation->toArray(), ]; } }