$this->id, 'code' => $this->code, 'name' => $this->name, 'item_type' => $this->item_type, 'item_category' => $this->item_category, 'unit' => $this->unit, 'is_active' => $this->is_active, // options → 최상위로 노출 'item_name' => $this->getOption('item_name'), 'item_sep' => $this->getOption('item_sep'), 'item_bending' => $this->getOption('item_bending'), 'item_spec' => $this->getOption('item_spec'), 'material' => $this->getOption('material'), 'model_name' => $this->getOption('model_name'), 'model_UA' => $this->getOption('model_UA'), 'search_keyword' => $this->getOption('search_keyword'), 'rail_width' => $this->getOption('rail_width'), 'registration_date' => $this->getOption('registration_date'), 'author' => $this->getOption('author'), 'memo' => $this->getOption('memo'), // 케이스 전용 'exit_direction' => $this->getOption('exit_direction'), 'front_bottom_width' => $this->getOption('front_bottom_width'), 'box_width' => $this->getOption('box_width'), 'box_height' => $this->getOption('box_height'), // 전개도 'bendingData' => $this->getOption('bendingData'), // PREFIX 관련 'prefix' => $this->getOption('prefix'), 'length_code' => $this->getOption('length_code'), 'length_mm' => $this->getOption('length_mm'), // 추적 'legacy_bending_num' => $this->getOption('legacy_bending_num'), // 계산값 'width_sum' => $this->getWidthSum(), 'bend_count' => $this->getBendCount(), // 메타 'created_at' => $this->created_at?->format('Y-m-d H:i:s'), 'updated_at' => $this->updated_at?->format('Y-m-d H:i:s'), ]; } private function getWidthSum(): ?int { $data = $this->getOption('bendingData', []); if (empty($data)) { return null; } $last = end($data); return isset($last['sum']) ? (int) $last['sum'] : null; } private function getBendCount(): int { $data = $this->getOption('bendingData', []); return count(array_filter($data, fn ($d) => ($d['rate'] ?? '') !== '')); } }