public function mapper($entity, $entityMap = null)
    {
        if ($entity instanceof Wrapper) {
            throw new MappingException('Tried to instantiate mapper on wrapped Entity');
        }

        $entity = $this->resolveEntityClass($entity);

        $entity = $this->getInverseMorphMap($entity);

        // Return existing mapper instance if exists.
        if (array_key_exists($entity, $this->mappers)) {
            return $this->mappers[$entity];
        } else {
            return $this->buildMapper($entity, $entityMap);
        }
    }