I have question about how to “correctly” write my application.
I would like to follow the service/DAO/mapper/entity model and I think that I fully understand it but I found out that some things which I want to do might collide with general conception of this model.
I have these database tables:

I have simple ProductDbMapper which gets product’s data from database and returns them as a Product entity so I can use it like this:
echo $productEntity->getName();
$productEntity->setPrice(29.9);
I think that it would be great to be able to use somethink like this:
echo $productEntity->getManufacturer()->getName();
The “getManufacturer()” method would simply query another service/DAO for the manufacturer by id. I know that the correct way how to get manufacturer of a product is:
$product = $productService->getProduct(5);
$manufacturer = $manufacturerService->getManufacturerByProduct($product);
But I think that “the fluent” solution is much simplier – it’s easy to understand and fun to use. Actually it’s pretty natural. I tried to implement this by callbacks. I passed the callback which calls manufacturer’s service to Product entity in my ProductMapper.
Problem is that it looks like I’m trying to follow the 5 layer model and at the same time I’m trying to avoid it. So my question is: does this look like a good solution? Does it make sense? How could I achieve the same (magic) in better way?
I’ve been doing some research for couple of days and I came to conclusion that the best way to achieve what I want is to stop trying to code it myself and just learn to use existing ORM. Because everything what I’ve been trying to do was creating of my own ORM. And I know that this is bad idea. I will stick with Doctrine 2.