Fixes #816 UnitOfWork::doDetach wasn't clearing documentUpserts

Added newline at end of file
Add missing XSD attributes for index options at field-level
Refactor XML index parsing (make field/index tags consistent)

Ensure that we're parsing the same attributes in the XSD. Make boolean checks consistent with other parsing (check for "true" instead of "false").
Support numeric index options in XML
Test parsing of numeric expireAfterSeconds index option
Merge pull request #843
Countable implementation for DocumentRepository
Merge pull request #820 from malarzm/gh816

Fixes #816 UnitOfWork::doDetach wasn't clearing documentUpserts
Merge pull request #853 from malarzm/countable_repository

Countable implementation for DocumentRepository
Revert "Countable implementation for DocumentRepository"

This reverts commit 76392d5fa9b0a874435c3fbb8a0fd631201f140c from #853.
Merge pull request #858 from doctrine/revert-countable

Revert "Countable implementation for DocumentRepository"
Update typo in `events` doc
Merge pull request #859 from ahmedmhmd/patch-1

Update typo in `events` doc
Fix build of lookup table for grouped ids

The ODM allows the use of custom types for identifier fields, however it currently uses the PHP value of an identifier as an array index key for grouping IDs together. This throws errors when the PHP value is a non-scalar.
Fix Proxy initializer and cloner for custom identifier types

Current implementation relies on DocumentPersister::load() behavior for transforming a scalar or MongoId argument to the appropriate selection criteria, but this check fails when the identifier is a custom type (e.g. embedded object).

Fixed by always appropriately passing an array of criteria instead.
Do not use keys in DocumentPersister calls to Cursor::toArray()

Allowing iterator_to_array() to use document "_id" fields as array keys is problematic when documents have non-scalar keys (e.g. embedded objects or MongoBinData, which seems to always return "<Mongo Binary Data>" as its string value). See #854 for more context.

This change also reverts ec69eaa2c5fc825a797bcb38e5eb20f4187a8949 from #401. Technically, inverse side relationships should be read-only, so there should be no reason for a set strategy. The previous behavior was also inconsistent with owning side relationships, which used keys from the actual array/object containing the references (not the "_id" fields of the referenced documents).
Regression test for ref-many and proxy support of custom IDs (#852)
Merge pull request #852
Fix typo in argument description
Handle child classes that are unlisted in parent discriminator maps

For embedded/referenced documents: if a child class has a discriminator field but is not present in the parent class' map, its FQCN should be used as the discriminator. This is necessary to ensure that the proper embedded/referenced class is created during hydration.

For top-level documents, we can rely on the original ClassMetadataInfo::hasDiscriminator() method, which would only store a discriminator if both the field and mapping are set. This is acceptable because the class name is known when executing a query. An edge case occurs when looking up an unmapped child class by the parent class name, as DocumentPersister::addDiscriminatorToPreparedQuery() will add discriminator criteria that ends up excluding the unmapped child class. A possible fix for that would be including all known, unmapped child classes within the discriminator field's $in criteria.

Fixes #788.