/** * Get real class name of a reference that could be a proxy * * @param string $className Class name of reference object * * @return string */ protected function getRealClass($className) { if (Version::compare('2.2.0') <= 0) { return ClassUtils::getRealClass($className); } if (substr($className, -5) === 'Proxy') { return substr($className, 0, -5); } return $className; }
/** * Checks the dependent ODM MongoDB library components * for compatibility * * @throws DependentComponentNotFoundException * @throws IncompatibleComponentVersionException */ public static function checkODMMongoDBDependencies() { // doctrine common library if (!class_exists('Doctrine\\Common\\Version')) { throw new DependentComponentNotFoundException("Doctrine\\Common library is either not registered by autoloader or not installed"); } if (\Doctrine\Common\Version::compare(self::VERSION) > 0) { throw new IncompatibleComponentVersionException("Doctrine\\Common library is older than expected for these extensions"); } // doctrine mongodb library if (!class_exists('Doctrine\\MongoDB\\Database')) { throw new DependentComponentNotFoundException("Doctrine\\MongoDB library is either not registered by autoloader or not installed"); } // doctrine ODM MongoDB library if (!class_exists('Doctrine\\ODM\\MongoDB\\Version')) { throw new DependentComponentNotFoundException("Doctrine\\ODM\\MongoDB library is either not registered by autoloader or not installed"); } if (\Doctrine\ODM\MongoDB\Version::compare('1.0.0BETA3-DEV') > 0) { throw new IncompatibleComponentVersionException("Doctrine\\ODM\\MongoDB library is older than expected for these extensions"); } }