use ClassUtils::getClass() instead of get_class()
added support for merge()

see http://doctrine-project.org/jira/browse/PHPCR-13