public function detach() { if ($this->attachedServer) { $this->attachedServer->attachedClients->detach($this); $this->attachedServer = null; } }