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

Public Member Functions

 __construct ($table, $key, &$db)
 
 getProperties ($public=true)
 
 getKeyName ($multiple=false)
 
 getDbo ()
 
 getError ()
 
 getErrors ()
 
 setPrimaryKey ($key, $keyForm=0)
 
 getPKey ()
 
 setObligatoryKeys ($key)
 
 setUniqueName ($name)
 
 setLoggable ()
 
 setTranslatable ($langFields)
 
 setLanguage ($tag)
 
 getTranslatableFields ()
 
 setLockable ()
 
 setOrderable ($key= 'ordering', $auto=true)
 
 setHashable ($key)
 
 setOmittedHashFields (array $fields)
 
 setSlug ($slugAutoName, $key= 'slug')
 
 setTableShortCut ($prefix)
 
 setRules ($input)
 
 getRules ()
 
 emptyCache ()
 
 setParameterable ($paramsFieldName, $varsToPushParam, $overwrite=false)
 
 bind ($src, $ignore=array())
 
 setCryptedFields ($fieldNames)
 
 getCryptedFields ()
 
 showFullColumns ($typeKey=0, $typeValue=0, $properties=true)
 
 loadFields ()
 
 loadFieldValues ($array=true)
 
 checkDataContainsTableFields ($from, $ignore=array())
 
 save ($src, $orderingFilter= '', $ignore= '')
 
 setLoggableFieldsForStore ()
 
 load ($oid=null, $overWriteLoadName=0, $andWhere=0, $tableJoins=array(), $joinKey=0)
 
 getLoaded ()
 
 encryptFields ()
 
 decryptFields ()
 
 store ($updateNulls=false)
 
 storeParams ()
 
 checkCreateUnique ($tbl_name, $name)
 
 setCheckVendorId ()
 
 hashEntry ($set=true)
 
 integrity ()
 
 check ()
 
 bindChecknStore (&$data, $preload=false, $langOnly=false)
 
 bindChecknStoreNoLang (&$data, $preload=false)
 
 fixOrdering ($where= '')
 
 move ($dirn, $where= '', $orderingkey=0)
 
 getNextOrder ($where= '', $orderingkey=0)
 
 reorder ($where= '', $orderingkey=0)
 
 checkout ($who, $oid=null)
 
 checkin ($oid=null)
 
 toggle ($field, $val=NULL)
 
 resetErrors ()
 
 delete ($oid=null, $where=0)
 
 isMysql51Plus ()
 
 getMysqlVersion ()
 
 checkAndDelete ($table, $whereField=0, $andWhere= '')
 
 _modifyColumn ($_act, $_col, $_type= '', $_col2= '')
 
 reset ()
 
 attachObserver (JObserverInterface $observer)
 
- Public Member Functions inherited from vObject
 __toString ()
 
 get ($prop, $def=null)
 
 set ($prop, $value=null)
 
 setProperties ($props)
 

Static Public Member Functions

static getInstance ($type, $prefix= 'VmTable', $config=array())
 
static addIncludePath ($path=null)
 
static bindParameterableToSubField (&$obj, $varsToPush, $field='params')
 
static bindParameterable (&$obj, $xParams, $varsToPushParam)
 
static checkTableExists ($table)
 
static bindTo (&$obj, $src, $internals=false, $ignore=array())
 
 isCheckedOut ($with=0, $against=null)
 

Public Attributes

 $_xParams = 0
 
 $_varsToPushParam = array()
 
 $_translatable = false
 
 $_cryptedFields = false
 
 $_ltmp = false
 
 $_loadedWithLangFallback = 0
 
 $_loaded = false
 
 $_tablePreFix = ''
 

Protected Member Functions

 _lock ()
 
 _unlock ()
 
 _getAssetName ()
 
 _getAssetTitle ()
 
 _getAssetParentId ($table=null, $id=null)
 

Protected Attributes

 $_tbl = ''
 
 $_tbl_lang = null
 
 $_tbl_key =''
 
 $_tbl_keys = ''
 
 $_pkey = ''
 
 $_pkeyForm = ''
 
 $_obkeys = array()
 
 $_unique = false
 
 $_unique_name = array()
 
 $_orderingKey = 'ordering'
 
 $_slugAutoName = ''
 
 $_slugName = ''
 
 $_db = false
 
 $_rules
 
 $_trackAssets = false
 
 $_locked = false
 
 $_loggable = false
 
 $_translatableFields = array()
 
 $_hashName = ''
 
 $_omittedHashFields = array()
 
 $_langTag = null
 
 $_updateNulls = false
 

Static Protected Attributes

static $_cache = array()
 

Private Attributes

 $_lhash = 0
 

Constructor & Destructor Documentation

VmTable::__construct (   $table,
  $key,
$db 
)
Parameters
string$table
string$key
JDatabase$db

Member Function Documentation

VmTable::_getAssetName ( )
protected

Method to compute the default name of the asset. The default name is in the form table_name.id where id is the value of the primary key of the table.

Returns
string
Since
11.1
VmTable::_getAssetParentId (   $table = null,
  $id = null 
)
protected

Method to get the parent asset under which to register this one. By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists. The extended class can define a table and id to lookup. If the asset does not exist it will be created.

Parameters
JTable$tableA JTable object for the asset parent.
integer$idId to look up
Returns
integer
Since
11.1
VmTable::_getAssetTitle ( )
protected

Method to return the title to use for the asset table. In tracking the assets a title is kept for each asset so that there is some context available in a unified access manager. Usually this would just return $this->title or $this->name or whatever is being used for the primary name of the row. If this method is not overridden, the asset name is used.

Returns
string The string to use as the title in the asset table.

11.1

VmTable::_lock ( )
protected

Method to lock the database table for writing.

Returns
boolean True on success.
Since
11.1
Exceptions
JDatabaseException
VmTable::_modifyColumn (   $_act,
  $_col,
  $_type = '',
  $_col2 = '' 
)

Add, change or drop userfields

Parameters
string$_actAction: ADD, DROP or CHANGE (synonyms available, see the switch cases)
string$_colColumn name
string$_typefieldtype
string$_col2Second Column name
Returns
boolean True on success
Author
Oscar van Eijk

stAn - note: i disabled deleting of user data when a column (shopper field) is deleted. If a deletion of specific user or order is needed, it can be done separatedly The column if not set with $_col2 will be renamed to ORIGINALNAME_DELETED_{timestamp()} and depending on mysql version it's definition will change

VmTable::_unlock ( )
protected

Method to unlock the database table for writing.

Returns
boolean True on success.
Since
11.1
static VmTable::addIncludePath (   $path = null)
static

Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.

Parameters
mixed$pathA filesystem path or array of filesystem paths to add.
Returns
array An array of filesystem paths to find JTable classes in.

11.1

VmTable::attachObserver ( JObserverInterface  $observer)

Implement JObservableInterface: Adds an observer to this instance. This method will be called fron the constructor of classes implementing JObserverInterface which is instanciated by the constructor of $this with JObserverMapper::attachAllObservers($this)

Parameters
JObserverInterface | JTableObserver$observerThe observer object
Returns
void
Since
3.1.2
VmTable::bind (   $src,
  $ignore = array() 
)

Method to bind an associative array or object to the JTable instance.This method only binds properties that are publicly accessible and optionally takes an array of properties to ignore when binding.

Parameters
mixed$srcAn associative array or object to bind to the JTable instance.
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Returns
boolean True on success.

11.1

VmTable::bindChecknStore ( $data,
  $preload = false,
  $langOnly = false 
)

As shortcat, Important the & MUST be there, even in php5.3

Author
Max Milbers
Parameters
array/obj$data input data as assoc array or obj
boolean$preloadYou can preload the data here too preserve not updated data
Returns
array/obj $data the updated data
VmTable::bindChecknStoreNoLang ( $data,
  $preload = false 
)
static VmTable::bindParameterable ( $obj,
  $xParams,
  $varsToPushParam 
)
static

This function must be Takes the bounded values at obj of the field $xParams and adds them as attributs of obj

Parameters
$obj
$xParams
$varsToPushParam
static VmTable::bindParameterableToSubField ( $obj,
  $varsToPush,
  $field = 'params' 
)
static

Maps the parameters to a subfield. usefull for the JForm

Author
Max Milbers
Parameters
$obj
$varsToPush
string$field
static VmTable::bindTo ( $obj,
  $src,
  $internals = false,
  $ignore = array() 
)
static
Parameters
$obj
$src
array$ignore
Returns
bool
VmTable::check ( )
Author
Max Milbers
Parameters
VmTable::checkAndDelete (   $table,
  $whereField = 0,
  $andWhere = '' 
)
VmTable::checkCreateUnique (   $tbl_name,
  $name 
)
VmTable::checkDataContainsTableFields (   $from,
  $ignore = array() 
)
VmTable::checkin (   $oid = null)

Checks in a row

public

Parameters
mixedThe primary key value for the row
Returns
boolean True if successful, or if checkout is not supported
VmTable::checkout (   $who,
  $oid = null 
)

Checks out a row

public

Parameters
integerThe id of the user
mixedThe primary key value for the row
Returns
boolean True if successful, or if checkout is not supported
static VmTable::checkTableExists (   $table)
static
VmTable::decryptFields ( )
VmTable::delete (   $oid = null,
  $where = 0 
)
VmTable::emptyCache ( )
VmTable::encryptFields ( )

Typo, had wrong name

Deprecated:
heavily
VmTable::fixOrdering (   $where = '')

Description will make sure that all items in the table are not using the same ordering values

Author
stAn public $where -> limits the categories if a child category of another one
VmTable::getCryptedFields ( )
VmTable::getDbo ( )
VmTable::getError ( )
Returns
string|void
VmTable::getErrors ( )
static VmTable::getInstance (   $type,
  $prefix = 'VmTable',
  $config = array() 
)
static

Static method to get an instance of a JTable class if it can be found in the table include paths. To add include paths for searching for JTable classes

See also
JTable::addIncludePath().
Parameters
string$typeThe type (name) of the JTable class to get an instance of.
string$prefixAn optional prefix for the table class name.
array$configAn optional array of configuration values for the JTable object.
Returns
mixed A JTable object if found or boolean false if one could not be found.

11.1

VmTable::getKeyName (   $multiple = false)
VmTable::getLoaded ( )
VmTable::getMysqlVersion ( )
VmTable::getNextOrder (   $where = '',
  $orderingkey = 0 
)

Returns the ordering value to place a new item last in its group

public

Parameters
stringquery WHERE clause for selecting MAX(ordering).
VmTable::getPKey ( )
VmTable::getProperties (   $public = true)

Returns an associative array of object properties.

Parameters
boolean$publicIf true, returns only the public properties.
Returns
array
Since
11.1
See also
get()
VmTable::getRules ( )

Method to get the rules for the record.

Returns
JAccessRules object
Since
11.1
VmTable::getTranslatableFields ( )
VmTable::hashEntry (   $set = true)
VmTable::integrity ( )
VmTable::isCheckedOut (   $with = 0,
  $against = null 
)
static

Check if an item is checked out

This function can be used as a static function too, when you do so you need to also provide the a value for the $against parameter.

public

Parameters
integer$withThe userid to preform the match with, if an item is checked out by this user the function will return false
integer$againstThe userid to perform the match against when the function is used as a static function.
Returns
boolean
VmTable::isMysql51Plus ( )
VmTable::load (   $oid = null,
  $overWriteLoadName = 0,
  $andWhere = 0,
  $tableJoins = array(),
  $joinKey = 0 
)

Technic to inject params as table attributes

Author
Max Milbers $TableJoins array of table names to add and left join to find ID
VmTable::loadFields ( )
VmTable::loadFieldValues (   $array = true)
VmTable::move (   $dirn,
  $where = '',
  $orderingkey = 0 
)

Description

Author
Joomla Team, Max Milbers public
Parameters
$dirn
$where
VmTable::reorder (   $where = '',
  $orderingkey = 0 
)

Compacts the ordering sequence of the selected records

public

Parameters
stringAdditional where query to limit ordering to a particular subset of records
VmTable::reset ( )
VmTable::resetErrors ( )
VmTable::save (   $src,
  $orderingFilter = '',
  $ignore = '' 
)

Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. The method will check a row in once the data has been stored and if an ordering filter is present will attempt to reorder the table rows based on the filter. The ordering filter is an instance property name. The rows that will be reordered are those whose value matches the JTable instance for the property specified.

Parameters
mixed$srcAn associative array or object to bind to the JTable instance.
string$orderingFilterFilter for the order updating
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Returns
boolean True on success.

11.1

VmTable::setCheckVendorId ( )
VmTable::setCryptedFields (   $fieldNames)

Sets fields encrypted

Author
Max Milbers
Parameters
$fieldNames
VmTable::setHashable (   $key)
VmTable::setLanguage (   $tag)
VmTable::setLockable ( )
VmTable::setLoggable ( )
VmTable::setLoggableFieldsForStore ( )

Function setting the loggable data hack procted In case you want to override the value for administrators, just set the created_on to "0000-00-00 00:00:00"

Author
Max Milbers
VmTable::setObligatoryKeys (   $key)
VmTable::setOmittedHashFields ( array  $fields)
VmTable::setOrderable (   $key = 'ordering',
  $auto = true 
)
VmTable::setParameterable (   $paramsFieldName,
  $varsToPushParam,
  $overwrite = false 
)

This function defines a database field as parameter field, which means that some values get injected there As delimiters are used | for the pair and = for key, value

Author
Max Milbers
Parameters
string$paramsFieldName
string$varsToPushParam
boolean$overwrite
VmTable::setPrimaryKey (   $key,
  $keyForm = 0 
)
VmTable::setRules (   $input)

Method to set rules for the record.

Parameters
mixed$inputA JAccessRules object, JSON string, or array.
Returns
void
Since
11.1
VmTable::setSlug (   $slugAutoName,
  $key = 'slug' 
)
VmTable::setTableShortCut (   $prefix)
VmTable::setTranslatable (   $langFields)
Author
Patrick Kohl,
Max Milbers
VmTable::setUniqueName (   $name)
VmTable::showFullColumns (   $typeKey = 0,
  $typeValue = 0,
  $properties = true 
)

Gives Back the columns of the current table, sets the properties on the table.

Author
Max Milbers
Parameters
int$typeKeyuse "Field" to get the effect of getTableColumns
int$typeValueuse "Type" to get the effect of getTableColumns
bool$propertiesdisable setting of columns as table properties
VmTable::store (   $updateNulls = false)

Derived from JTable Records in this table do not need to exist, so we might need to create a record even if the primary key is set. Therefore we need to overload the store() function. Technic to inject params as table attributes and to encrypt data

Author
Max Milbers
See also
libraries/joomla/database/JTablestore($updateNulls)
VmTable::storeParams ( )
VmTable::toggle (   $field,
  $val = NULL 
)

toggle (0/1) a field or invert by $val

Author
impleri
Max Milbers
Parameters
string$fieldthe field to toggle
boolean$valfield value (0/1)

Member Data Documentation

VmTable::$_cache = array()
staticprotected
VmTable::$_cryptedFields = false
VmTable::$_db = false
protected
VmTable::$_hashName = ''
protected
VmTable::$_langTag = null
protected
VmTable::$_lhash = 0
private
VmTable::$_loaded = false
VmTable::$_loadedWithLangFallback = 0
VmTable::$_locked = false
protected
VmTable::$_loggable = false
protected
VmTable::$_ltmp = false
VmTable::$_obkeys = array()
protected
VmTable::$_omittedHashFields = array()
protected
VmTable::$_orderingKey = 'ordering'
protected
VmTable::$_pkey = ''
protected
VmTable::$_pkeyForm = ''
protected
VmTable::$_rules
protected
VmTable::$_slugAutoName = ''
protected
VmTable::$_slugName = ''
protected
VmTable::$_tablePreFix = ''
VmTable::$_tbl = ''
protected
VmTable::$_tbl_key =''
protected
VmTable::$_tbl_keys = ''
protected
VmTable::$_tbl_lang = null
protected
VmTable::$_trackAssets = false
protected
VmTable::$_translatable = false
VmTable::$_translatableFields = array()
protected
VmTable::$_unique = false
protected
VmTable::$_unique_name = array()
protected
VmTable::$_updateNulls = false
protected
VmTable::$_varsToPushParam = array()
VmTable::$_xParams = 0

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