attributes)) { $this->attributes['serverPartEntities'] = []; } if (!array_key_exists($partType, $this->attributes['serverPartEntities'])) { $this->attributes['serverPartEntities'][$partType] = []; } $this->attributes['serverPartEntities'][$partType][] = $entity; return $this; } public function setServerPartEntities(string $partType, array $serverPartEntities): ServerEntity { if (!array_key_exists('serverPartEntities', $this->attributes)) { $this->attributes['serverPartEntities'] = []; } $this->attributes['serverPartEntities'][$partType] = $serverPartEntities; return $this; } public function getServerPartEntities(string $partType): array { if (!array_key_exists('serverPartEntities', $this->attributes)) { return []; } if (!array_key_exists($partType, $this->attributes['serverPartEntities'])) { return []; } return $this->attributes['serverPartEntities'][$partType]; } //기본기능용 public function getCode(): string { return $this->attributes['code']; } public function getCustomTitle(): string { return sprintf("[%s] %s", $this->getCode(), $this->getTitle()); } public function getPrice(): int { return $this->attributes['price']; } }