attributes['name']; } //추가기능 public function getType(): string { return $this->attributes['type']; } //판매금액표시용 public function getSalePrice(array $options = []): string { $price = $this->attributes['price'] - $this->attributes['sale']; if (array_key_exists('format', $options)) { $price = sprintf($options['format'], number_format($price)); } return $price; } }