I'm working on an events site and have a one to many relationship between a production and its performances, when I have a performance object if I need its production id at the moment I have to do
$productionId = $performance->getProduction()->getId(); In cases when I literally just need the production id it seems like a waste to send off another database query to get a value that's already in the object somewhere. Is there a way round this?