Revert "PersistentCollection::count() with ReferenceMany InverseSide mapping queries DB without collection initialization"
Revert "PersistentCollection::count() with ReferenceMany InverseSide mapping queries DB without collection initialization"

This reverts commit bd7d99e290159e310469b0a14aee1aafc7df2381.

Conflicts:
        lib/Doctrine/ODM/MongoDB/PersistentCollection.php

Reverting, because not initializing counted incorrectly when:

        - the collection has the isInverseSide flag set
        - the collection is uninitialized
        - has had an item added using add(), making it dirty

Here's the previous (and broken before this commit) flow:

        - the collection is inverse-side and not initially initialized
        - we add an item via add()
                - has the side-effect of marking the collection as dirty
                - but still keeps the collection uninitialized
        - if count() is called now for this uninitialized inverse-side collection:
                - a query gets sent to the database to count the objects
                - the result of counting is 0, because:
                        - there's nothing in the DB yet
                        (assuming there really was nothing old there for starters)
                        - nobody cared that $this->coll had some items added to it
                        and the collection was dirty

The easiest fix I can think of is to restore the old behavior, which
causes initialize() to happen just in case.

alcaeus/mongodb-odm,Xosofox/mongodb-odm,coudenysj/mongodb-odm,lyft/mongodb-odm,rubenrua/mongodb-odm,doctrine/mongodb-odm,castarco/mongodb-odm,doctrine/mongodb-odm,jmikola/mongodb-odm,kevinyien/mongodb-odm,waldihuber/mongodb-odm,stylehub/mongodb-odm,alcaeus/mongodb-odm,danizord/mongodb-odm,Tony133/mongodb-odm,oswaldderiemaecker/mongodb-odm,aheinz-sg/mongodb-odm,malarzm/mongodb-odm,notrix/mongodb-odm,Soullivaneuh/mongodb-odm,stylehub/mongodb-odm,stylehub/mongodb-odm,malarzm/mongodb-odm,solocommand/mongodb-odm