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

Public Member Functions

 __construct ()
 
 prepareFieldDataSave ($field, &$data, $prefix= '')
 
 getUserfield ($id=0, $name= '')
 
 getUserfieldValues ($id=null)
 
 store (&$data)
 
 getUserFieldsFor ($layoutName, $type)
 
 getUserFields ($_sec= 'registration', $_switches=array(), $_skip=array('username', 'password', 'password2'))
 
 fieldPublished ($_field_name, $_sec='account')
 
 getUserFieldsFilled ($_selection, &$_userDataIn=null, $_prefix= '')
 
 getIfRequired ($fieldname)
 
 remove ($fieldIds)
 
 getUserfieldsList ($type=false)
 
 _getFilter ()
 
 _getListQuery ()
 
- 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)
 

Static Public Member Functions

static getCoreFields ()
 
- 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)
 

Static Public Attributes

static $_cache_ordered
 
static $_cache_named
 

Private Member Functions

 storeFieldValues ($_values, $_id)
 
 postData2FieldValues ($titles, $values, $virtuemart_userfield_id)
 

Additional Inherited Members

- 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')
 
- 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

VirtueMartModelUserfields::__construct ( )

constructs a VmModel setMainTable defines the maintable of the model

Author
Max Milbers

Member Function Documentation

VirtueMartModelUserfields::_getFilter ( )

If a filter was set, get the SQL WHERE clase

Returns
string text to add to the SQL statement
VirtueMartModelUserfields::_getListQuery ( )

Build the query to list all Userfields

Deprecated:
Returns
string SQL query statement
VirtueMartModelUserfields::fieldPublished (   $_field_name,
  $_sec = 'account' 
)

Return a boolean whethe the userfield is enabled in context of $_sec

public

Parameters
$_field_namename of the user field such as 'email'
$_secBT or ST, or one of the types of the fields: account, shipment, registration
Author
stAn
Returns
true or false

Note: this function will return a false result for skipped fields such as agreed, user_is_vendor

when used from shipment method, you can use $userFieldsModel =VmModel::getModel('Userfields'); $type = (($cart->ST == 0) ? 'BT' : 'ST'); if ($userFieldsModel->fieldPublished('zip', $type)) ....

static VirtueMartModelUserfields::getCoreFields ( )
static
VirtueMartModelUserfields::getIfRequired (   $fieldname)

Checks if a single field is required, used in the cart

Author
Max Milbers
Parameters
string$fieldname
VirtueMartModelUserfields::getUserfield (   $id = 0,
  $name = '' 
)

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

VirtueMartModelUserfields::getUserFields (   $_sec = 'registration',
  $_switches = array(),
  $_skip = array('username', 'password', 'password2') 
)

Retrieve an array with userfield objects

Parameters
string$sectionThe section the fields belong to (e.g. 'registration' or 'account')
array$_switchesArray to toggle these options:
  • published published fields only (default: true)
  • required Required fields only (default: false)
  • delimiters Exclude delimiters (default: false)
  • captcha Exclude Captcha type (default: false)
  • system System fields filter (no default; true: only system fields, false: exclude system fields)
array$_skipArray with fieldsnames to exclude. Default: array('username', 'password', 'password2', 'agreed'), specify array() to skip nothing.
See also
getUserFieldsFilled()
Author
Oscar van Eijk
Returns
array
VirtueMartModelUserfields::getUserFieldsFilled (   $_selection,
$_userDataIn = null,
  $_prefix = '' 
)
VirtueMartModelUserfields::getUserFieldsFor (   $layoutName,
  $type 
)
Author
Max Milbers
VirtueMartModelUserfields::getUserfieldsList (   $type = false)

Get the userfields for the BE list

Author
Max Milbers
Returns
NULL
VirtueMartModelUserfields::getUserfieldValues (   $id = null)

Retrieve the value records for the current $id if available for the current type

Updated by stAn to get userfieldvalues per specific id regardless on this->_id

Returns
array List wil values, or an empty array if none exist
VirtueMartModelUserfields::postData2FieldValues (   $titles,
  $values,
  $virtuemart_userfield_id 
)
private

Translate arrays form userfield_values to the format expected by the table class.

stAn Note -> when a field of [0] is deleted (or others), you cannot use count to itenerate the array

Parameters
array$titlesList of titles from the formdata
array$valuesList of values from the formdata
int$virtuemart_userfield_idID of the userfield to relate
Returns
array Data to bind to the userfield_values table
VirtueMartModelUserfields::prepareFieldDataSave (   $field,
$data,
  $prefix = '' 
)

Prepare a user field for database update

VirtueMartModelUserfields::remove (   $fieldIds)

Delete all record ids selected

Returns
boolean True is the remove was successful, false otherwise.
VirtueMartModelUserfields::store ( $data)

Bind the post data to the userfields table and save it

Returns
boolean True is the save was successful, false otherwise.
VirtueMartModelUserfields::storeFieldValues (   $_values,
  $_id 
)
private

Bind and write all value records

Parameters
array$_values
mixed$_idIf a new record is being inserted, it contains the virtuemart_userfield_id, otherwise the value true
Returns
boolean

Member Data Documentation

VirtueMartModelUserfields::$_cache_named
static
VirtueMartModelUserfields::$_cache_ordered
static

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