I have this MongoDB document: MyBundle/Document/Image
.
It represents an image, its path, width, and other attributes.
Now I need to manipulate images, and I think that besides my image manipulation library of choice, I should have an app-specific class to deal with this. I think it would be nice to do something like this:
$image_manager = new ImageManager;
$image = $image_repository->find($id);
$thumbnail = $image_manager->createThumbnail($image);
Now, I'm not sure if I want my ImageManager class to also deal with MongoDB queries, like a custom repository, so let's suppose I don't. Then where should I place my ImageManager class?
Do you think it would be wrong to let it handle both kinds of tasks? (eg: createThumbnail
and findAllImagesWithoutThumbnail
)