Let say that we have two tables: Post and Category and two posts that have the same category_id
, let say 1.
$post1->getCategory()->getName()
will load the category that has category_id 1
$post2->getCategory()->getName()
will do the same query to load the same category.
Is there any solution do not make the same query twice?