doctrine / couchdb-odm

A Document Mapper based on CouchDB
http://www.doctrine-project.org
MIT License
150 stars 53 forks source link

Missing __doctrineLoad__() function declaration #140

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi, the function in the doctrineLoad() doesn't exist, when loading a object by the proxy factory from the couchdb.

Attempted to call an undefined method named "__doctrineLoad__" of class "CouchDBProxies\__CG__\__CLASS__

After removing the doctrineLoad from the CouchDB DocumentManager, it works:

from

   /**
     * Initialize an object that is a lazy load proxy, or do nothing.
     *
     * @param object $obj
     */
    public function initializeObject($obj)
    {
        if ($obj instanceof PersistentCollection) {
            $obj->initialize();
        } else if ($obj instanceof Proxy\Proxy) {
            $obj->__doctrineLoad__();
        }
    }

to

    /**
     * Initialize an object that is a lazy load proxy, or do nothing.
     *
     * @param object $obj
     */
    public function initializeObject($obj)
    {
        if ($obj instanceof PersistentCollection) {
            $obj->initialize();
        }
    }

Is there a need for this function?

Ocramius commented 7 years ago

Should probably be $obj->__load()