hari === $other->hari && $this->sesi === $other->sesi; } /** * Mengembalikan string unik untuk keperluan hash/lookup. * Contoh: hari=2, sesi=3 → "2-3" */ public function toKey(): string { return "{$this->hari}-{$this->sesi}"; } /** * Membuat SchedulingSlot dari string key. * Contoh: "2-3" → SchedulingSlot(2, 3) */ public static function fromKey(string $key): self { [$hari, $sesi] = explode('-', $key); return new self((int) $hari, (int) $sesi); } }