Class

SAF_User

Methods

getId

getId()

Returns user’s Facebook ID

Return type:string|int

getData

getData()

Returns the user data

Return type:array

getFirstName

getFirstName()

Returns the user’s first name

Return type:string

getLastName

getLastName()

Returns the user’s last name

Return type:string

getName

getName()

Returns the user’s full name

Return type:string

getGender

getGender()

Returns the user’s gender

Return type:string

getEmail

getEmail()

Returns the user’s email

Return type:string

getAgeRange

getAgeRange()

Returns the user’s age range

Return type:object containing min and max

getProfileUrl

getProfileUrl()

Returns the user’s profile URL

Return type:string

getProfilePicture

getProfilePicture()

Returns the user’s profile picture URL

Return type:string

getGrantedPerms

getGrantedPerms()

Returns the permissions the user granted

Return type:array

getRevokedPerms

getRevokedPerms()

Returns the permissions the user revoked

Return type:array

isAppDeveloper

isAppDeveloper()

Returns true if the user is the app developer

Return type:string

isAuthenticated

isAuthenticated()

Returns true if the user is authenticated

Return type:boolean

hasPermission

hasPermission()

Returns true if a user has permission

Parameters:string – permission to check
Return type:boolean

__construct

__construct()

Constructor

Parameters:
  • SAF_Facebook
  • string|int
Return type:

void

_init

_init()

Init

Return type:void

_thirdPartyCookieFix

_thirdPartyCookieFix()

Checks if a session cookie is not set and if so, automatically redirects the user to the base URL with a ‘saf_redirect’ URL param. The app then starts the session on the ‘real’ server and immediately redirects back to the proper URL (tab or convas);

Return type:string

_isAppDeveloper

_isAppDeveloper()

Returns true if the user is the app developer

Return type:boolean

_checkPermissions

_checkPermissions()

Check permissions

Return type:void

_getValue

_getValue()

Returns a user key value whether it exists or not

Parameters:
  • string – key to check for
  • mixed – default value if not set
Return type:

mixed