protected function getUserId(UserInterface $user)
    {
        $class = $this->container->getParameter('tree_house.keystone.model.user.class');
        $meta = $this->getDoctrine()->getManagerForClass($class)->getClassMetadata($class);

        $ids = $meta->getIdentifierValues($user);
        if (sizeof($ids) === 1) {
            return current($ids);
        }

        return $ids;
    }