VirtueMart  3.2.14.9808
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
VirtueMartModelUser Class Reference
Inheritance diagram for VirtueMartModelUser:
Inheritance graph
[legend]
Collaboration diagram for VirtueMartModelUser:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 
 setId ($cid)
 
 getCurrentUser ()
 
 getVendor ($vendorId=1, $return=TRUE)
 
 getUser ()
 
 getContactDetails ()
 
 store (&$data)
 
 saveUserData (&$data, $trigger=true)
 
 storeVendorData ($data)
 
 setFraudProtection ()
 
 storeAddress (&$data)
 
 validateUserData (&$data, $type='BT', $showInfo=false)
 
 _prepareUserFields (&$data, $type, $userinfo=0, $prefix= '')
 
 getBTuserinfo_id ($id=0)
 
 getUserInfoInUserFields ($layoutName, $type, $uid, $cart=true, $isVendor=false)
 
 storeUserDataByFields ($data, $type, $toggles, $skips)
 
 remove ($userIds)
 
 removeAddress ($virtuemart_userinfo_id)
 
 getUserList ()
 
 getSwitchUserList ($superVendor=null, $adminID=false)
 
 _getFilter ()
 
 getUserAddressList ($_uid=0, $_type= 'ST', $_virtuemart_userinfo_id=-1)
 
 getCustomerNumberById ()
 
 getSuperAdminCount ()
 
 getAclGroupIndentedTree ()
 
- Public Member Functions inherited from VmModel
 __construct ($cidName='cid', $config=array())
 
 setDebugSql ($b)
 
 getName ()
 
 setState ($property, $value=null)
 
 getState ($property=null, $default=null)
 
 getTable ($name= '', $prefix= 'Table', $options=array())
 
 setIdName ($idName)
 
 getIdName ()
 
 getId ()
 
 setId ($id)
 
 setMainTable ($maintablename, $maintable=0)
 
 getDefaultOrdering ()
 
 addvalidOrderingFieldName ($add)
 
 removevalidOrderingFieldName ($name)
 
 setDefaultValidOrderingFields ($defaultTable=null)
 
 _getOrdering ($preTable='')
 
 checkFilterOrder ($toCheck, $view=0, $task= '')
 
 checkValidOrderingFieldName ($toCheck)
 
 checkFilterDir ($toCheck, $view=0, $task= '')
 
 getPagination ($perRow=5)
 
 setPaginationLimits ()
 
 getTotal ()
 
 setGetCount ($withCount)
 
 exeSortSearchListQuery ($object, $select, $joinedTables, $whereString= '', $groupBy= '', $orderBy= '', $filter_order_Dir= '', $nbrReturnProducts=false)
 
 emptyCache ()
 
 getData ($id=0)
 
 store (&$data)
 
 remove ($ids)
 
 setToggleName ($togglesName)
 
 toggle ($field, $val=NULL, $cidname=0, $tablename=0, $view=false)
 
 move ($direction, $filter=null)
 
 saveorder ($cid=array(), $order, $filter=null)
 
 addImages ($obj, $limit=0)
 
 resetErrors ()
 
- Public Member Functions inherited from vObject
 __toString ()
 
 get ($prop, $def=null)
 
 set ($prop, $value=null)
 
 setProperties ($props)
 

Public Attributes

 $searchTable = 'juser'
 
- Public Attributes inherited from VmModel
 $_id = 0
 
 $_data = null
 
 $_query = null
 
 $_total = null
 
 $_pagination = 0
 
 $_limit = 0
 
 $_limitStart = 0
 
 $_maintable = ''
 
 $_maintablename = ''
 
 $_idName = ''
 
 $_cidName = 'cid'
 
 $_togglesName = null
 
 $_selectedOrderingDir = 'DESC'
 
 $_noLimit = false
 
 $_tablePreFix = ''
 
 $_validOrderingFieldName = array()
 
 $_validFilterDir = array('ASC','DESC')
 

Private Member Functions

 setUserId ($id)
 
 sendRegistrationEmail ($user, $password, $doUserActivation)
 

Private Attributes

 $_defaultShopperGroup = 0
 
 $customer_number = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from VmModel
static addTablePath ($path)
 
static addIncludePath ($path= '', $prefix= '')
 
static getInstance ($type, $prefix= '', $config=array())
 
static getModel ($name=false)
 
static joinLangTables ($tablename, $prefix, $on, $method=0)
 
static joinLangSelectFields ($langFields, $as=true)
 
static joinLangLikeFields ($langFields, $keyword)
 
static joinLangLikeField ($searchField, $keyword)
 
- Protected Member Functions inherited from VmModel
 populateState ()
 
 _createTable ($name, $prefix= 'Table', $config=array())
 
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
- Static Protected Member Functions inherited from VmModel
static _createFileName ($type, $parts=array())
 
- Protected Attributes inherited from VmModel
 $__state_set = null
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $_maxItems = 1000
 

Constructor & Destructor Documentation

VirtueMartModelUser::__construct ( )

Constructor for the user model.

The user ID is read and determined if it is an array of ids or just one single id.

Member Function Documentation

VirtueMartModelUser::_getFilter ( )

If a filter was set, get the SQL WHERE clase

Returns
string text to add to the SQL statement
VirtueMartModelUser::_prepareUserFields ( $data,
  $type,
  $userinfo = 0,
  $prefix = '' 
)
VirtueMartModelUser::getAclGroupIndentedTree ( )

Return a list of Joomla ACL groups.

The returned object list includes a group anme and a group name with spaces prepended to the name for displaying an indented tree.

Author
RickG
Returns
ObjectList List of acl group objects.
VirtueMartModelUser::getBTuserinfo_id (   $id = 0)
VirtueMartModelUser::getContactDetails ( )

Retrieve contact info for a user if any

Returns
array of null
VirtueMartModelUser::getCurrentUser ( )
VirtueMartModelUser::getCustomerNumberById ( )
VirtueMartModelUser::getSuperAdminCount ( )

Get the number of active Super Admins

Returns
integer
VirtueMartModelUser::getSwitchUserList (   $superVendor = null,
  $adminID = false 
)
VirtueMartModelUser::getUser ( )

Retrieve the detail record for the current $id if the data has not already been loaded.

Author
Max Milbers
VirtueMartModelUser::getUserAddressList (   $_uid = 0,
  $_type = 'ST',
  $_virtuemart_userinfo_id = -1 
)

Retrieve a single address for a user

Parameters
$_uidint User ID
$_virtuemart_userinfo_idstring Optional User Info ID
$_typestring, addess- type, ST (ShipTo, default) or BT (BillTo). Empty string to ignore
VirtueMartModelUser::getUserInfoInUserFields (   $layoutName,
  $type,
  $uid,
  $cart = true,
  $isVendor = false 
)
Author
Max Milbers
VirtueMartModelUser::getUserList ( )

Retrieve a list of users from the database.

Author
Max Milbers
Returns
object List of user objects
VirtueMartModelUser::getVendor (   $vendorId = 1,
  $return = TRUE 
)

Sets the internal user id with given vendor Id

Author
Max Milbers
Parameters
int$vendorId
VirtueMartModelUser::remove (   $userIds)

Delete all record ids selected

Returns
boolean True is the remove was successful, false otherwise.
VirtueMartModelUser::removeAddress (   $virtuemart_userinfo_id)
VirtueMartModelUser::saveUserData ( $data,
  $trigger = true 
)

This function is NOT for anonymous. Anonymous just get the information directly sent by email. This function saves the vm Userdata for registered JUsers. TODO, setting of shoppergroup isnt done

TODO No reason not to use this function for new users, but it requires a Joomla <user> plugin that gets fired by the onAfterStoreUser. I'll built that (OvE)

Notice: As long we do not have the silent registration, an anonymous does not get registered. It is enough to send the virtuemart_order_id with the email. The order is saved with all information in an extra table, so there is no need for a silent registration. We may think about if we actually need/want the feature silent registration The information of anonymous is stored in the order table and has nothing todo with the usermodel!

Author
Max Milbers
Oscar van Eijk return boolean
VirtueMartModelUser::sendRegistrationEmail (   $user,
  $password,
  $doUserActivation 
)
private

This uses the shopFunctionsF::renderAndSendVmMail function, which uses a controller and task to render the content and sents it then.

Author
Oscar van Eijk
Max Milbers
Christopher Roussel
Valérie Isaksen
VirtueMartModelUser::setFraudProtection ( )

FraudProtection to comply to the French financial Law 2018

Author
Valérie Isaksen
VirtueMartModelUser::setId (   $cid)

public function Resets the user id and data

Author
Max Milbers
VirtueMartModelUser::setUserId (   $id)
private

Internal function

Parameters
unknown_type$id
VirtueMartModelUser::store ( $data)

Bind the post data to the JUser object and the VM tables, then saves it It is used to register new users This function can also change already registered users, this is important when a registered user changes his email within the checkout.

Author
Max Milbers
Oscar van Eijk
Returns
boolean True is the save was successful, false otherwise.
VirtueMartModelUser::storeAddress ( $data)

Take a data array and save any address info found in the array.

Author
unknown, oscar, max milbers
Parameters
array$data(Posted) user data
sting$_tableTable name to write to, null (default) not to write to the database
boolean$_cartAttention, this was deleted, the address to cart is now done in the controller (True to write to the session (cart))
Returns
boolean True if the save was successful, false otherwise.
VirtueMartModelUser::storeUserDataByFields (   $data,
  $type,
  $toggles,
  $skips 
)

This stores the userdata given in userfields

Deprecated:
seems unused
Author
Max Milbers
VirtueMartModelUser::storeVendorData (   $data)
VirtueMartModelUser::validateUserData ( $data,
  $type = 'BT',
  $showInfo = false 
)

Test userdata if valid

Author
Max Milbers
Parameters
Stringif BT or ST
ObjectIf given, an object with data address data that must be formatted to an array
Returns
redirectMsg, if there is a redirectMsg, the redirect should be executed after

Member Data Documentation

VirtueMartModelUser::$_defaultShopperGroup = 0
private
VirtueMartModelUser::$customer_number = 0
private

Retrieves the Customer Number of the user specified by ID

Parameters
int$_idUser ID
Returns
string Customer Number
VirtueMartModelUser::$searchTable = 'juser'

The documentation for this class was generated from the following file: