public static function onInclude(Event $event)
    {
        $dispatcher = $event->getDispatcher();
        if (null !== $dispatcher->getApplication()) {
            if (null === $em = $dispatcher->getApplication()->getEntityManager()) {
                return;
            }

            $shortClassname = AbstractClassContent::getShortClassname($event->getTarget());
            $fullClassname = AbstractClassContent::getFullClassname($event->getTarget());
            foreach (class_parents($fullClassname) as $classname) {
                $em->getClassMetadata($classname)->addDiscriminatorMapClass($shortClassname, $fullClassname);

                if ('BackBee\ClassContent\AbstractClassContent' === $classname) {
                    break;
                }
            }
        }
    }