Do you have the ability to alter the schema of your database? If so, I'd consider consolidating this into one table.
Barring that, you may want to try a one-to-one relationship in Doctrine. Perhaps something like:
class File {
private $id;
private $name;
private $mime;
private $content;
}
class Content {
private $id;
private $data;
private $fileId;
}
If you map Content->fileId with a one-to-one relationship to File->id, then you can do things like:
$file->getContent()->getData();
$file->getContent()->setData("something different");
Here's some more info on one-to-one mappings: http://docs.doctrine-project.org/en/2.0.x/reference/association-mapping.html#one-to-one-unidirectional