Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0.0BETA2
-
Component/s: None
-
Labels:None
Description
Not sure if it is ODM issue or some PHP Reflection issue, or I just don't getting something, but following test case won't save the file:
/** @Document(db="tests", collection="files") */ class file { /** @Id */ protected $id; /** * @File * @var \MongoGridFSFile */ protected $file; function __construct($file) {$this->file = $file;} } $f = new file(__DIR__ . '/test.txt'); $dm->persist($f); $dm->flush();
The problem is in annotation @var \MongoGridFSFile. Without it file is saved properly. Also, if I remove "\" in front of MongoGridFSFile, file will be also saved properly. Weird thing.
I think this is a problem with the annotations parser and nothing with the ODM.