public function setService($code) { if (!array_key_exists($code, self::$services)) { throw new Exception('Error: That service code does not exist.'); } $this->service = $code; }