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

Public Member Functions

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

Public Attributes

 $_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

 populateState ()
 
 _createTable ($name, $prefix= 'Table', $config=array())
 
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 

Static Protected Member Functions

static _createFileName ($type, $parts=array())
 

Protected Attributes

 $__state_set = null
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $_maxItems = 1000
 

Private Attributes

 $_withCount = true
 

Static Private Attributes

static $_cache = array()
 
static $_vmmodels = array()
 

Constructor & Destructor Documentation

VmModel::__construct (   $cidName = 'cid',
  $config = array() 
)

Member Function Documentation

static VmModel::_createFileName (   $type,
  $parts = array() 
)
staticprotected

Create the filename for a resource

Parameters
string$typeThe resource type to create the filename for.
array$partsAn associative array of filename information.
Returns
string The filename
Since
11.1
VmModel::_createTable (   $name,
  $prefix = 'Table',
  $config = array() 
)
protected

Method to load and return a model object.

Parameters
string$nameThe name of the view
string$prefixThe class prefix. Optional.
array$configConfiguration settings to pass to JTable::getInstance
Returns
mixed Model object or boolean false if failed
Since
11.1
See also
JTable::getInstance
VmModel::_getList (   $query,
  $limitstart = 0,
  $limit = 0 
)
protected

Gets an array of objects from the results of database query.

Parameters
string$queryThe query.
integer$limitstartOffset.
integer$limitThe number of records.
Returns
array An array of results.
Since
11.1
VmModel::_getListCount (   $query)
protected

Returns a record count for the query

Parameters
string$queryThe query.
Returns
integer Number of rows for query
Since
11.1
VmModel::_getOrdering (   $preTable = '')
VmModel::addImages (   $obj,
  $limit = 0 
)

Since an object like product, category dont need always an image, we can attach them to the object with this function The parameter takes a single product or arrays of products, look for BE/views/product/view.html.php for an exampel using it

Author
Max Milbers
Parameters
object$objsome object with a _medias xref table
static VmModel::addIncludePath (   $path = '',
  $prefix = '' 
)
static

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

Parameters
mixed$pathA path or array[sting] of paths to search.
string$prefixA prefix for models.
Returns
array An array with directory elements. If prefix is equal to '', all directories are returned.
Since
11.1
static VmModel::addTablePath (   $path)
static

Adds to the stack of model table paths in LIFO order.

Parameters
mixed$pathThe directory as a string or directories as an array to add.
Returns
void
Since
12.2
VmModel::addvalidOrderingFieldName (   $add)
VmModel::checkFilterDir (   $toCheck,
  $view = 0,
  $task = '' 
)
VmModel::checkFilterOrder (   $toCheck,
  $view = 0,
  $task = '' 
)
VmModel::checkValidOrderingFieldName (   $toCheck)
VmModel::emptyCache ( )
VmModel::exeSortSearchListQuery (   $object,
  $select,
  $joinedTables,
  $whereString = '',
  $groupBy = '',
  $orderBy = '',
  $filter_order_Dir = '',
  $nbrReturnProducts = false 
)

exeSortSearchListQuery

Author
Max Milbers
Patrick Kohl
Parameters
boolean$objectuse single result array = 2, assoc. array = 1 or object list = 0 as return value
string$selectthe fields to select
string$joinedTablesthe string of the joined tables or the table
string$whereStringfor the where condition
string$groupBy
string$orderBy
string$filter_order_Dir
VmModel::getData (   $id = 0)
Author
Max Milbers
VmModel::getDefaultOrdering ( )
VmModel::getId ( )
VmModel::getIdName ( )
static VmModel::getInstance (   $type,
  $prefix = '',
  $config = array() 
)
static

Returns a Model object, always creating it

Parameters
string$typeThe model type to instantiate
string$prefixPrefix for the model class name. Optional.
array$configConfiguration array for model. Optional.
Returns
mixed A model object or false on failure
Since
11.1
static VmModel::getModel (   $name = false)
static
Author
Patrick Kohl
Max Milbers
VmModel::getName ( )

Method to get the model name

The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor

Returns
string The name of the model
Since
12.2
Exceptions
Exception
VmModel::getPagination (   $perRow = 5)

Loads the pagination

Author
Max Milbers
VmModel::getState (   $property = null,
  $default = null 
)

Method to get model state variables

Parameters
string$propertyOptional parameter name
mixed$defaultOptional default value
Returns
object The property where specified, the state object where omitted
Since
11.1
VmModel::getTable (   $name = '',
  $prefix = 'Table',
  $options = array() 
)

Method to get a table object, load it if necessary.

Parameters
string$nameThe table name. Optional.
string$prefixThe class prefix. Optional.
array$optionsConfiguration array for model. Optional.
Returns
JTable A JTable object
Since
11.1
VmModel::getTotal ( )

Gets the total number of entries TODO filters and search ar not set

Author
Max Milbers
Returns
int Total number of entries in the database
static VmModel::joinLangLikeField (   $searchField,
  $keyword 
)
static
static VmModel::joinLangLikeFields (   $langFields,
  $keyword 
)
static
static VmModel::joinLangSelectFields (   $langFields,
  $as = true 
)
static
static VmModel::joinLangTables (   $tablename,
  $prefix,
  $on,
  $method = 0 
)
static
VmModel::move (   $direction,
  $filter = null 
)

Original From Joomla Method to move a weblink @ Author Kohl Patrick $filter the field to group by public

Returns
boolean True on success
Since
1.5
VmModel::populateState ( )
protected

Method to auto-populate the model state.

This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the model configuration flag to ignore the request is set.

Returns
void
Note
Calling getState in this method will result in recursion.
Since
11.1
VmModel::remove (   $ids)

Delete all record ids selected

Author
Max Milbers
Returns
boolean True is the delete was successful, false otherwise.
VmModel::removevalidOrderingFieldName (   $name)
VmModel::resetErrors ( )
VmModel::saveorder (   $cid = array(),
  $order,
  $filter = null 
)

Original From Joomla Method to move a weblink @ Author Kohl Patrick $filter the field to group by public

Returns
boolean True on success
Since
1.5
VmModel::setDebugSql (   $b)
VmModel::setDefaultValidOrderingFields (   $defaultTable = null)

This function sets the valid ordering fields for this model with the default table attributes

Author
Max Milbers
Parameters
unknown_type$defaultTable
VmModel::setGetCount (   $withCount)
VmModel::setId (   $id)

Resets the id and data

Author
Max Milbers
VmModel::setIdName (   $idName)
VmModel::setMainTable (   $maintablename,
  $maintable = 0 
)
VmModel::setPaginationLimits ( )
VmModel::setState (   $property,
  $value = null 
)

Method to set model state variables

Parameters
string$propertyThe name of the property.
mixed$valueThe value of the property to set or null.
Returns
mixed The previous value of the property or null if not set.
Since
12.2
VmModel::setToggleName (   $togglesName)
VmModel::store ( $data)
VmModel::toggle (   $field,
  $val = NULL,
  $cidname = 0,
  $tablename = 0,
  $view = false 
)

toggle (0/1) a field or invert by $val for multi IDS;

Author
Patrick Kohl
Parameters
string$fieldthe field to toggle
string$postNamethe name of id Post (Primary Key in table Class constructor)

Member Data Documentation

VmModel::$__state_set = null
protected
VmModel::$_cache = array()
staticprivate
VmModel::$_cidName = 'cid'
VmModel::$_data = null
VmModel::$_id = 0
VmModel::$_idName = ''
VmModel::$_limit = 0
VmModel::$_limitStart = 0
VmModel::$_maintable = ''
VmModel::$_maintablename = ''
VmModel::$_maxItems = 1000
protected
VmModel::$_noLimit = false
VmModel::$_pagination = 0
VmModel::$_query = null
VmModel::$_selectedOrderingDir = 'DESC'
VmModel::$_tablePreFix = ''
VmModel::$_togglesName = null
VmModel::$_total = null
VmModel::$_validFilterDir = array('ASC','DESC')
VmModel::$_validOrderingFieldName = array()
VmModel::$_vmmodels = array()
staticprivate
VmModel::$_withCount = true
private
VmModel::$event_clean_cache = null
protected
VmModel::$name
protected
VmModel::$option = null
protected
VmModel::$state
protected

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