I have 4 tables:
branches
(contains branch info)offered_class_types
(each branch has a set of classes it has available)class_sessions
(each class type has its session, like day, evening, and night)class_dates
(each date corresponds to a session)
So my flow: each date corresponds to a session (by a code that links the two directly) which corresponds to a type by two things 1. a branch id and 2. a class name (branches can offer the same class types which can have the same sessions). Each class type corresponds to the branches table using that same branch id it used to correspond with the sessions table.
I would like to turn this code into a one query, instead of the two it is now. Prior to switching to Propel it was in a single query.
$class = ClassDatesQuery::create()->findPk(160);
$classSession = $class->getOfferedSessionsRelatedByCode();
$classType = OfferedClassTypesQuery::create()
->filterByType($classSession->getClassname())
->filterByBranchid($classSession->getBranchid())
->find();