Fixing Silex Doctrine 2 ODM Notice: Undefined index: embedOne Error


Using Doctrine MongoDB Object Document Manager (ODM) and trying to persist a model throws the error:

Notice: Undefined index: embedOne in /vagrant/composer/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php on line 341


Thanks to Douglas Reith on the doctrin-user list it becomes obvious that it was because the embedOne data within my YAML file was indented two spaces too much, and pulling it back one level so it was at the same indentation as fields fixes the problem.