public function genre() { if (empty($this->main_genre)) { if (empty($this->moviegenres)) { $genres = $this->genres(); } if (!empty($genres)) { $this->main_genre = $this->moviegenres[0]; } } return $this->main_genre; }