deviceRepository = $deviceRepository; } public function createFromDiscoveredHost( string $name, string $ipAddress, ?string $macAddress = null, ?string $hostname = null, ?string $vendor = null ): Device { $device = new Device(); $device->name = $name; $device->primaryIp = $ipAddress; $device->macAddress = $macAddress; $device->hostname = $hostname; $device->vendor = $vendor; $device->type = 'unknown'; $device->status = 'active'; $device->importance = 'normal'; $this->deviceRepository->save($device); return $device; } public function getAllDevices(): array { return $this->deviceRepository->findAll(); } public function getDevice(int $id): ?Device { return $this->deviceRepository->findById($id); } public function updateDevice(Device $device): void { $this->deviceRepository->save($device); } public function deleteDevice(int $id): void { $this->deviceRepository->delete($id); } }