url = $this->assignFromArray('url', $data, true); $this->platform = $this->assignFromArray($data['platform'], $platforms, true); $this->game = $this->assignFromArray($data['id'], $games, true); $this->category = $this->assignFromArray('category', $data); } public function __toString() { return $this->getName(); } /* Get the download URL for the demo. */ public function getURL() { return $this->url; } /* Get the platform for the demo. */ public function getPlatform() { return $this->platform; } /* Get the game for the demo. */ public function getGame() { return $this->game; } /* Get the category for the demo. */ public function getCategory() { return $this->category; } /* Get the category for the demo. */ public function getName() { $gameName = $this->game->getName(); $platformName = $this->platform->getName(); $category = $this->getCategory(); return "$gameName ($platformName $category Demo)"; } } //