src/TreeHouse/KeystoneBundle/Controller/TokenController.php
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;
    }
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;
    }
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 ; }
Returns the user identifier.
If this is a single identifier, that value is returned.
Otherwise all the identifiers are returned as an array.

@param UserInterface $user

@return array|mixed
Returns the user identifier . If this is a single identifier that value is returned . Otherwise all the identifiers are returned as an array .