protected function registerBehaviors(EventManager $evm, Configuration $config)
	{
		$reader = new AnnotationReader;

		if ($cache = $config->getMetadataCacheImpl())
		{
			$reader = new CachedReader($reader, $cache);
		}

		foreach ($this->getConfig('behaviors', array()) as $behavior)
		{
			if ($class = DiC::resolve('doctrine.behavior.'.$behavior))
			{
				$class->setAnnotationReader($reader);

				$this->configureBehavior($behavior, $class);

				$evm->addEventSubscriber($class);
			}
		}

		if ($mapping = $config->getMetadataDriverImpl())
		{
			$type = 'registerMappingIntoDriverChainORM';

			if ($this->getConfig('behavior.superclass', false))
			{
				$type = 'registerAbstractMappingIntoDriverChainORM';
			}

			DoctrineExtensions::$type(
				$mapping,
				$reader
			);
		}
	}