public function getToken($id)
    {
        if ($id) {
            $ownerClass = $this->tokenConfig['owner'];
            $owner = DataObject::get_by_id($ownerClass, $id);

            if ($owner) {
                $tokenDBColumn = $this->tokenConfig['DBColumn'];
                return $owner->{$tokenDBColumn};
            } else {
                user_error("API Token owner '$ownerClass' not found with ID = $id", E_USER_WARNING);
            }
        } else {
            user_error("TokenAuthenticator::getToken() requires an ID as argument.", E_USER_WARNING);
        }
    }
public function getToken($id)
    {
        if ($id) {
            $ownerClass = $this->tokenConfig['owner'];
            $owner = DataObject::get_by_id($ownerClass, $id);

            if ($owner) {
                $tokenDBColumn = $this->tokenConfig['DBColumn'];
                return $owner->{$tokenDBColumn};
            } else {
                user_error("API Token owner '$ownerClass' not found with ID = $id", E_USER_WARNING);
            }
        } else {
            user_error("TokenAuthenticator::getToken() requires an ID as argument.", E_USER_WARNING);
        }
    }
public function getToken ( $ id ) { if ( $ id ) { $ ownerClass = $ this -> tokenConfig [ 'owner' ] ; $ owner = DataObject :: get_by_id ( $ ownerClass , $ id ) ; if ( $ owner ) { $ tokenDBColumn = $ this -> tokenConfig [ 'DBColumn' ] ; return $ owner -> { $ tokenDBColumn } ; } else { user_error ( "API Token owner '$ownerClass' not found with ID = $id" , E_USER_WARNING ) ; } } else { user_error ( "TokenAuthenticator::getToken() requires an ID as argument." , E_USER_WARNING ) ; } }
Return the stored API token for a specific owner

@param  integer $id ID of the token owner
@return string      API token for the owner
Return the stored API token for a specific owner