So far I have this code:
$list = $this->modelsManager
->createBuilder()
->columns(array("SeriesList.*", "User.*", "Entry.*"))
->from("SeriesList")
->join("User")
->join("Entry")
->andWhere("SeriesList.id = '$id'")
->getQuery()
->execute();
Each row in the "Entry" database is an item that has a id, id of the series list it belongs to, its series id, and what type of series it is. The type of series specifies what table the series id can be found in.
The problem is that I want SeriesList(s) to may contain different types of objects. For example, the SeriesList "Favorites" may contain 3 shows and 4 books, Show and Book being different models which interface with separate tables.
Would I have to keep joining for all the models the list might contain? Or is there a better way?