API/Lite

From aMember Pro Documentation
Revision as of 07:45, 17 November 2011 by Alex-scott (Talk | contribs)

Jump to: navigation, search

Am_Lite is a special class that you may include into your application to get access to aMember database information without overhead of including entire aMember Pro codebase and its bootstrap. Am_Lite does not require any other files to work.

Am_Lite class is located inside file amember/library/Am/Lite.php and provides the following functions:

Am_Lite::getInstance()->isLoggedIn()  
checks if user has been authenticated
Am_Lite::getInstance()->getUsername()  
get username
Am_Lite::getInstance()->getName()  
returns first&last name of logged-in customer, not HTML-escaped!
Am_Lite::getInstance()->getEmail()  
returns e-mail address of logged-in customer, not HTML-escaped
Am_Lite::getInstance()->getLogoutURL()  
returns URL of aMember logout page
Am_Lite::getInstance()->getProfileURL()  
returns URL of aMember user profile page
Am_Lite::getInstance()->getLoginURL()  
returns URL of aMember login page
Am_Lite::getInstance()->getSignupURL()  
returns URL of aMember signup page
Am_Lite::getInstance()->renderLoginForm() 
renders aMember login form
Am_Lite::getInstance()->getRootURL()  
returns root URL of aMember installation
Am_Lite::getInstance()->haveSubscriptions()  
returns true if user have active subscription to $search
Am_Lite::getInstance()->hadSubscriptions()  
return true if user had before or has now subscription to $search
Am_Lite::getInstance()->getExpire()  
return greatest expiration date for $search
Am_Lite::getInstance()->getPayments()  
return all payment records for currently logged-in user
Am_Lite::getInstance()->getUserLinks()  
return all links defined for currently logged-in user
Am_Lite::getInstance()->getAccess()  
return all access records for currently logged-in user
Am_Lite::getInstance()->isUserActive()  
has the currently logged-in user an active subscription?
Am_Lite::getInstance()->getProducts()  
get array of all defined in aMember products (product_id => title)