ドキュメント内のフィールドを、値が別のドキュメントへの参照である連想配列としてマップするにはどうすればよいですか?
Fileディスク上のファイルを表すドキュメントがあるとします。このようなもの:
/** @Document */
class File {
    /** @Id */
    protected $id;
    /** @String */
    protected $filename;
    // Getter and setters omitted
}
また、画像を表す別のドキュメントには、さまざまなサイズの画像への参照が格納されます。このようなもの:
/** @Document */
class Image {
    /** @Id */
    protected $id;
    /** ???? */
    protected $files;
    // Getter and setters omitted
}
ファイルへの参照を、サイズをキーにして画像ドキュメントに保存できるようにしたいと考えています。例:
$file1 = new File('/some/path/to/a/file');
$file2 = new File('/some/path/to/another/file');
$image = new Image();
$image->setFiles(array('50x50' => $file1,'100x100' => $file2));
結果の MongoDB ドキュメントは次のようになります。
{
    "_id" : ObjectId("...."),
    "files" : {
        "50x50" : {
            "$ref" : "files",
            "$id" : ObjectId("...")
        },
        "100x100" : {
            "$ref" : "files",
            "$id" : ObjectId("...")
        }
    }
}
では、ドキュメントfiles内のフィールドをどのようにマッピングすればよいでしょうか?Image