I have a Symfony 2 environment in which I am using a custom data type with Doctrine's MongoDB ODM mappings. This all works, except occasionally; when I go to clear the cache or install the assets I sometimes receive the following error:
[InvalidArgumentException]
Invalid type specified "..."
This seems to always happen with the next command I issue to the console after I have cleared the cache, later operations all succeed. Doctrine seems to have issues intermittently finding it, and I suspect it has to do with where I'm registering the type and when that occurs with relationship to when Doctrine processes the mappings.
The type is being added as part of the boot()
method in another bundle which may not always be included.
- What is happening here?
- Can I somehow ensure that the type is loaded earlier, or provide it in a configuration file? As far as I can tell there is no way, at present, using the MongoDB configuration to specify custom types in a
.yml
file as described for the ORM here.