Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFTable
+ Graphe d'héritage de FOFTable:

Fonctions membres publiques

 __construct ($table, $key, &$db, $config=array())
 
 setKnownFields ($fields, $initialise=false)
 
 getKnownFields ()
 
 hasField ($fieldName)
 
 addKnownField ($field, $initialise=false)
 
 removeKnownField ($field)
 
 addBehavior ($name, $config=array())
 
 setTriggerEvents ($newState=false)
 
 getTriggerEvents ()
 
 hasTags ()
 
 setHasTags ($newState=false)
 
 setTablePrefix ($prefix)
 
 setSkipChecks ($skip)
 
 load ($keys=null, $reset=true)
 
 check ()
 
 reset ()
 
 getClone ()
 
 canDelete ($oid=null, $joins=null)
 
 bind ($src, $ignore=array())
 
 store ($updateNulls=false)
 
 move ($delta, $where='')
 
 reorder ($where='')
 
 checkout ($userId, $oid=null)
 
 checkin ($oid=null)
 
 isCheckedOut ($with=0, $unused_against=null)
 
 copy ($cid=null)
 
 publish ($cid=null, $publish=1, $user_id=0)
 
 delete ($oid=null)
 
 hit ($oid=null, $log=false)
 
 toCSV ($separator=',')
 
 getData ()
 
 getCSVHeader ($separator=',')
 
 getTableFields ($tableName=null)
 
 getTableAlias ()
 
 setTableAlias ($string)
 
 getColumnAlias ($column)
 
 setColumnAlias ($column, $columnAlias)
 
 getQueryJoin ($asReference=false)
 
 setQueryJoin ($query)
 
 setInput (FOFInput $input)
 
 getFields ()
 
 getAssetName ()
 
 getAssetKey ()
 
 getAssetTitle ()
 
 getAssetParentId ($table=null, $id=null)
 
 setAssetKey ($assetKey)
 
 getTableName ()
 
 getKeyName ()
 
 getId ()
 
 getDbo ()
 
 setDBO ($db)
 
 setRules ($input)
 
 getRules ()
 
 isAssetsTracked ()
 
 setAssetsTracked ($state)
 
 save ($src, $orderingFilter='', $ignore='')
 
 getNextOrder ($where='')
 
 setConfig (array $config)
 
 getContentType ()
 
 getRelations ()
 
 getConfigProvider ()
 
 getConfigProviderKey ()
 
 checkContentType ($alias=null)
 
- Fonctions membres publiques hérités de FOFUtilsObject
 __construct ($properties=null)
 
 __toString ()
 
 def ($property, $default=null)
 
 get ($property, $default=null)
 
 getProperties ($public=true)
 
 getError ($i=null, $toString=true)
 
 getErrors ()
 
 set ($property, $value=null)
 
 setProperties ($properties)
 
 setError ($error)
 

Fonctions membres publiques statiques

static getInstance ($type, $prefix='JTable', $config=array())
 
static & getAnInstance ($type=null, $prefix='JTable', $config=array())
 
static forceInstance ($key=null, $instance=null)
 
static addIncludePath ($path=null)
 

Fonctions membres protégées

 getQueryJoinFields ()
 
 normalizeSelectFields ($fields)
 
 isQuoted ($column)
 
 onBeforeBind (&$from)
 
 onAfterLoad (&$result)
 
 onBeforeStore ($updateNulls)
 
 onAfterBind (&$src)
 
 onAfterStore ()
 
 onBeforeMove ($updateNulls)
 
 onAfterMove ()
 
 onBeforeReorder ($where='')
 
 onAfterReorder ()
 
 onBeforeDelete ($oid)
 
 onAfterDelete ($oid)
 
 onBeforeHit ($oid, $log)
 
 onAfterHit ($oid)
 
 onBeforeCopy ($oid)
 
 onAfterCopy ($oid)
 
 onBeforePublish (&$cid, $publish)
 
 onAfterReset ()
 
 onBeforeReset ()
 
 getAsset ()
 
 _lock ()
 
 _unlock ()
 
 getUcmCoreAlias ($alias, $null="null")
 

Attributs protégés

 $config = array()
 
 $_tbl = ''
 
 $_tbl_key = ''
 
 $_db
 
 $_trackAssets = false
 
 $_has_tags = false
 
 $_rules
 
 $_locked = false
 
 $_trigger_events = false
 
 $_tableAlias = false
 
 $_columnAlias = array()
 
 $_autoChecks = false
 
 $_skipChecks = array()
 
 $_tableExists = true
 
 $_assetKey = ''
 
 $input = null
 
 $_queryJoin = null
 
 $_tablePrefix = ''
 
 $knownFields = array()
 
 $configProvider = null
 
 $tableDispatcher = null
 
 $default_behaviors = array('tags', 'assets')
 
 $_relations = null
 
 $_configProviderKey = ''
 
 $contentType = null
 
- Attributs protégés hérités de FOFUtilsObject
 $_errors = array()
 

Attributs protégés statiques

static $instances = array()
 
static $_includePaths = array()
 
static $tableFieldCache = array()
 
static $tableCache = array()
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $table,
  $key,
$db,
  $config = array() 
)

Class Constructor.

Paramètres
string$tableName of the database table to model.
string$keyName of the primary key field in the table.
FOFDatabaseDriver&$dbDatabase driver
array$configThe configuration parameters array

Références $behavior, $component, $config, $db, $default_behaviors, $fields, $key, $type, addBehavior(), elseif, getColumnAlias(), FOFPlatform\getInstance(), getKnownFields(), getQueryJoinFields(), getTableFields(), JLoader\import(), null, reset(), setKnownFields(), et FOFInflector\singularize().

Documentation des fonctions membres

◆ _lock()

_lock ( )
protected

Method to lock the database table for writing.

Renvoie
boolean True on success.
Exceptions
RuntimeException

◆ _unlock()

_unlock ( )
protected

Method to unlock the database table for writing.

Renvoie
boolean True on success.

Référencé par store().

◆ addBehavior()

addBehavior (   $name,
  $config = array() 
)

Adds a behavior to the table

Paramètres
string$nameThe name of the behavior
array$configOptional Behavior configuration
Renvoie
boolean

Références $behavior, $config, et $name.

Référencé par __construct().

◆ addIncludePath()

static addIncludePath (   $path = null)
static

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

Paramètres
mixed$pathA filesystem path or array of filesystem paths to add.
Renvoie
array An array of filesystem paths to find FOFTable classes in.

Référencé par FOFModel\addTablePath().

◆ addKnownField()

addKnownField (   $field,
  $initialise = false 
)

Add a field to the known fields array

Paramètres
string$fieldThe name of the field to add
boolean$initialiseShould we initialise the variable to null?
Renvoie
void

Références $field, et null.

◆ bind()

bind (   $src,
  $ignore = array() 
)

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

Paramètres
mixed$srcAn associative array or object to bind to the FOFTable instance.
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Renvoie
boolean True on success.
Exceptions
InvalidArgumentException

Références getKnownFields(), onAfterBind(), et onBeforeBind().

Référencé par load(), FOFModel\loadhistory(), et store().

◆ canDelete()

canDelete (   $oid = null,
  $joins = null 
)

Generic check for whether dependencies exist for this object in the db schema

Paramètres
integer$oidThe primary key of the record to delete
array$joinsAny joins to foreign table, used to determine if dependent records exist
Renvoie
boolean True if the record can be deleted

Références $_db, $_tbl_key, $db, $i, $key, $oid, $option, $prefix, $query, et FOFUtilsObject\setError().

◆ check()

check ( )

Based on fields properties (nullable column), checks if the field is required or not

Renvoie
boolean

Références $_tbl_key, $field, $fields, $text, getColumnAlias(), getKnownFields(), getTableFields(), getTableName(), et FOFUtilsObject\setError().

◆ checkContentType()

checkContentType (   $alias = null)

Check if a UCM content type exists for this resource, and create it if it does not

Paramètres
string$aliasThe content type alias (optional)
Renvoie
null

◆ checkin()

checkin (   $oid = null)

Check in (unlock) a record

Paramètres
integer$oidThe primary key value of the record to unlock
Renvoie
boolean True on success

Références $_tbl_key, $oid, $query, getColumnAlias(), getKnownFields(), et null.

Référencé par publish().

◆ checkout()

checkout (   $userId,
  $oid = null 
)

Check out (lock) a record

Paramètres
integer$userIdThe locking user's ID
integer$oidThe primary key value of the record to lock
Renvoie
boolean True on success

Références $_tbl_key, $date, $oid, $query, $userId, getColumnAlias(), FOFPlatform\getInstance(), getKnownFields(), et null.

◆ copy()

copy (   $cid = null)

Copy (duplicate) one or more records

Paramètres
integer | array$cidThe primary key value (or values) or the record(s) to copy
Renvoie
boolean True on success

Références $_tbl_key, $item, getColumnAlias(), getKnownFields(), isCheckedOut(), load(), null, onAfterCopy(), onBeforeCopy(), reset(), FOFUtilsObject\setError(), store(), et FOFUtilsArray\toInteger().

◆ delete()

delete (   $oid = null)

Delete a record

Paramètres
integer$oidThe primary key value of the item to delete
Exceptions
UnexpectedValueException
Renvoie
boolean True on success

Références $_tbl_key, $oid, $query, load(), onAfterDelete(), et onBeforeDelete().

◆ forceInstance()

static forceInstance (   $key = null,
  $instance = null 
)
static

Force an instance inside class cache. Setting arguments to null nukes all or part of the cache

Paramètres
string | null$keyTableClass to replace. Set it to null to nuke the entire cache
FOFTable | null$instanceInstance to replace. Set it to null to nuke $key instances
Renvoie
bool Did I correctly switch the instance?

Références $key, et elseif.

◆ getAnInstance()

static& getAnInstance (   $type = null,
  $prefix = 'JTable',
  $config = array() 
)
static

Returns a static object instance of a particular table type

Paramètres
string$typeThe table name
string$prefixThe prefix of the table class
array$configOptional configuration variables
Renvoie
FOFTable

Références $component, $config, $configProvider, $option, $path, $prefix, $type, elseif, FOFPlatform\getInstance(), null, FOFInflector\pluralize(), et FOFInflector\singularize().

Référencé par FOFModel\_createTable().

◆ getAsset()

getAsset ( )
protected

Loads the asset table related to this table. This will help tests, too, since we can mock this function.

Renvoie
bool|JTableAsset False on failure, otherwise JTableAsset

◆ getAssetKey()

getAssetKey ( )

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.

Exceptions
UnexpectedValueException
Renvoie
string

◆ getAssetName()

getAssetName ( )

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.

Exceptions
UnexpectedValueException
Renvoie
string

◆ getAssetParentId()

getAssetParentId (   $table = null,
  $id = null 
)

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.

Paramètres
FOFTable$tableA FOFTable object for the asset parent.
integer$idId to look up
Renvoie
integer

◆ getAssetTitle()

getAssetTitle ( )

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.

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

◆ getClone()

getClone ( )

Clones the current object, after resetting it

Renvoie
static

Références $key, getKeyName(), et null.

◆ getColumnAlias()

getColumnAlias (   $column)

Method to return the real name of a "special" column such as ordering, hits, published etc etc. In this way you are free to follow your db naming convention and use the built in Joomla functions.

Paramètres
string$columnName of the "special" column (ie ordering, hits etc etc)
Renvoie
string The string that identify the special

Référencé par __construct(), check(), checkin(), checkout(), copy(), hasField(), hit(), isCheckedOut(), move(), publish(), et reorder().

◆ getConfigProvider()

getConfigProvider ( )

Gets a reference to the configuration parameters provider for this table

Renvoie
FOFConfigProvider

Référencé par FOFTableRelations\__construct().

◆ getConfigProviderKey()

getConfigProviderKey ( )

Returns the configuration parameters provider's key for this table

Renvoie
string

Référencé par FOFTableRelations\__construct().

◆ getContentType()

getContentType ( )

Get the content type for ucm

Renvoie
string The content type alias

When tags was first introduced contentType variable didn't exist - so we guess one This will fail if content history behvaiour is enabled. This code is deprecated and will be removed in FOF 3.0 in favour of the content type class variable

◆ getCSVHeader()

getCSVHeader (   $separator = ',')

Get the header for exporting item list to CSV

Paramètres
string$separatorCSV separator. Tip: use "\t" to get a TSV file instead.
Renvoie
string The CSV file's header

Références $separator, et getKnownFields().

◆ getData()

getData ( )

Exports the table in array format

Renvoie
array

Références getKnownFields().

◆ getDbo()

getDbo ( )

Method to get the FOFDatabaseDriver object.

Renvoie
FOFDatabaseDriver The internal database driver object.

◆ getFields()

getFields ( )

Get the columns from database table.

Renvoie
mixed An array of the field names, or false if an error occurs.
Obsolète:
2.1

◆ getId()

getId ( )

Returns the identity value of this record

Renvoie
mixed

Référencé par FOFTableNested\equals().

◆ getInstance()

static getInstance (   $type,
  $prefix = 'JTable',
  $config = array() 
)
static

Returns a static object instance of a particular table type

Paramètres
string$typeThe table name
string$prefixThe prefix of the table class
array$configOptional configuration variables
Renvoie
FOFTable

Références $config, $prefix, et $type.

Référencé par FOFDatabaseIterator\__construct(), FOFTableRelations\getIteratorFromRelation(), FOFFormFieldRelation\getOptions(), et FOFTableRelations\getTableFromRelation().

◆ getKeyName()

getKeyName ( )

Method to get the primary key field name for the table.

Renvoie
string The name of the primary key for the table.

Référencé par FOFTableRelations\__construct(), getClone(), et FOFModel\loadhistory().

◆ getKnownFields()

getKnownFields ( )

◆ getNextOrder()

getNextOrder (   $where = '')

Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. This is useful for placing a new item last in a group of items in the table.

Paramètres
string$whereWHERE clause to use for selecting the MAX(ordering) for the table.
Renvoie
mixed Boolean false an failure or the next ordering value as an integer.

◆ getQueryJoin()

getQueryJoin (   $asReference = false)

Get a JOIN query, used to join other tables

Paramètres
boolean$asReferenceReturn an object reference instead of a copy
Renvoie
FOFDatabaseQuery Query used to join other tables

Référencé par load().

◆ getQueryJoinFields()

getQueryJoinFields ( )
protected

Extracts the fields from the join query

Renvoie
array Fields contained in the join query

Référencé par __construct(), et reset().

◆ getRelations()

getRelations ( )

Returns the table relations object of the current table, lazy-loading it if necessary

Renvoie
FOFTableRelations

◆ getRules()

getRules ( )

Method to get the rules for the record.

Renvoie
JAccessRules object

◆ getTableAlias()

getTableAlias ( )

◆ getTableFields()

getTableFields (   $tableName = null)

Get the columns from a database table.

Paramètres
string$tableNameTable name. If null current table is used
Renvoie
mixed An array of the field names, or false if an error occurs.

Références $_tbl, $field, $fields, $name, $prefix, $tableCache, elseif, FOFPlatform\getInstance(), json_encode, et null.

Référencé par __construct(), check(), reset(), et store().

◆ getTableName()

getTableName ( )

Method to get the database table name for the class.

Renvoie
string The name of the database table being modeled.

Référencé par FOFTableRelations\__construct(), et check().

◆ getTriggerEvents()

getTriggerEvents ( )

Gets the events trigger switch state

Renvoie
boolean

Références $_trigger_events.

◆ getUcmCoreAlias()

getUcmCoreAlias (   $alias,
  $null = "null" 
)
protected

Utility methods that fetches the column name for the field. If it does not exists, returns a "null" string

Paramètres
string$aliasThe alias for the column
string$nullWhat to return if no column exists
Renvoie
string The column name

◆ hasField()

hasField (   $fieldName)

Does the specified field exist?

Paramètres
string$fieldNameThe field name to search (it's OK to use aliases)
Renvoie
bool

Références getColumnAlias().

◆ hasTags()

hasTags ( )

Gets the has tags switch state

Renvoie
bool

Références $_has_tags.

◆ hit()

hit (   $oid = null,
  $log = false 
)

Register a hit on a record

Paramètres
integer$oidThe primary key value of the record
boolean$logShould I log the hit?
Renvoie
boolean True on success

Références $_tbl_key, $oid, $query, getColumnAlias(), getKnownFields(), onAfterHit(), et onBeforeHit().

◆ isAssetsTracked()

isAssetsTracked ( )

Method to check if the record is treated as an ACL asset

Renvoie
boolean [description]

◆ isCheckedOut()

isCheckedOut (   $with = 0,
  $unused_against = null 
)

Is a record locked?

Paramètres
integer$withThe userid to preform the match with. If an item is checked out by this user the function will return false.
integer$unused_againstJunk inherited from JTable; ignore
Exceptions
UnexpectedValueException
Renvoie
boolean True if the record is locked by another user

Références $_tbl_key, getColumnAlias(), et null.

Référencé par copy().

◆ isQuoted()

isQuoted (   $column)
protected

Is the field quoted?

Paramètres
string$columnColumn field
Renvoie
bool Is the field quoted?

◆ load()

load (   $keys = null,
  $reset = true 
)

Method to load a row from the database by primary key and bind the fields to the FOFTable instance properties.

Paramètres
mixed$keysAn optional primary key value to load the row by, or an array of fields to match. If not set the instance property value is used.
boolean$resetTrue to reset the default values before loading the new row.
Renvoie
boolean True if successful. False if row not found.
Exceptions
RuntimeException
UnexpectedValueException

Références $_tbl_key, $field, $fields, $query, $row, $value, bind(), elseif, getKnownFields(), getQueryJoin(), null, onAfterLoad(), et reset().

Référencé par copy(), et delete().

◆ move()

move (   $delta,
  $where = '' 
)

Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. Negative numbers move the row up in the sequence and positive numbers move it down.

Paramètres
integer$deltaThe direction and magnitude to move the row in the ordering sequence.
string$whereWHERE clause to use for limiting the selection of rows to compact the ordering values.
Renvoie
mixed Boolean True on success.
Exceptions
UnexpectedValueException

Références $_tbl_key, $query, $row, elseif, getColumnAlias(), getKnownFields(), null, onAfterMove(), et onBeforeMove().

◆ normalizeSelectFields()

normalizeSelectFields (   $fields)
protected

Normalizes the fields, returning an associative array with all the fields. Ie array('foobar as foo, bar') becomes array('foobar' => 'foo', 'bar' => 'bar')

Paramètres
array$fieldsArray with column fields
Renvoie
array Normalized array

◆ onAfterBind()

onAfterBind ( $src)
protected

The event which runs after binding data to the class

Paramètres
object | array&$srcThe data to bind
Renvoie
boolean True to allow binding without an error

Référencé par bind().

◆ onAfterCopy()

onAfterCopy (   $oid)
protected

The even which runs after copying a record

Paramètres
integer$oidThe PK value of the record which was copied (not the new one)
Renvoie
boolean True to allow the copy without errors

Référencé par copy().

◆ onAfterDelete()

onAfterDelete (   $oid)
protected

The event which runs after deleting a record

Paramètres
integer$oidThe PK value of the record which was deleted
Renvoie
boolean True to allow the deletion without errors

Référencé par delete().

◆ onAfterHit()

onAfterHit (   $oid)
protected

The event which runs after hitting a record

Paramètres
integer$oidThe PK value of the record which was hit
Renvoie
boolean True to allow the hitting without errors

Référencé par hit().

◆ onAfterLoad()

onAfterLoad ( $result)
protected

The event which runs after loading a record from the database

Paramètres
boolean&$resultDid the load succeeded?
Renvoie
void

Référencé par load().

◆ onAfterMove()

onAfterMove ( )
protected

The event which runs after moving a record

Renvoie
boolean True to allow moving without an error

Référencé par move().

◆ onAfterReorder()

onAfterReorder ( )
protected

The event which runs after reordering a table

Renvoie
boolean True to allow the reordering to complete without an error

Référencé par reorder().

◆ onAfterReset()

onAfterReset ( )
protected

The event which runs after the object is reset to its default values.

Renvoie
boolean True to allow the reset to complete without errors

Référencé par reset().

◆ onAfterStore()

onAfterStore ( )
protected

The event which runs after storing (saving) data to the database

Renvoie
boolean True to allow saving without an error

Référencé par store().

◆ onBeforeBind()

onBeforeBind ( $from)
protected

The event which runs before binding data to the table

NOTE TO 3RD PARTY DEVELOPERS:

When you override the following methods in your child classes, be sure to call parent::method AFTER your code, otherwise the plugin events do NOT get triggered

Example: protected function onBeforeBind(){ // Your code here return parent::onBeforeBind() && $your_result; }

Do not do it the other way around, e.g. return $your_result && parent::onBeforeBind() Due to PHP short-circuit boolean evaluation the parent::onBeforeBind() will not be called if $your_result is false.

Paramètres
object | array&$fromThe data to bind
Renvoie
boolean True on success

Référencé par bind().

◆ onBeforeCopy()

onBeforeCopy (   $oid)
protected

The even which runs before copying a record

Paramètres
integer$oidThe PK value of the record being copied
Renvoie
boolean True to allow the copy to take place

Référencé par copy().

◆ onBeforeDelete()

onBeforeDelete (   $oid)
protected

The event which runs before deleting a record

Paramètres
integer$oidThe PK value of the record to delete
Renvoie
boolean True to allow the deletion

Référencé par delete().

◆ onBeforeHit()

onBeforeHit (   $oid,
  $log 
)
protected

The event which runs before hitting a record

Paramètres
integer$oidThe PK value of the record to hit
boolean$logShould we log the hit?
Renvoie
boolean True to allow the hit

Référencé par hit().

◆ onBeforeMove()

onBeforeMove (   $updateNulls)
protected

The event which runs before moving a record

Paramètres
boolean$updateNullsShould nulls be saved as nulls (true) or just skipped over (false)?
Renvoie
boolean True to allow moving

Référencé par move().

◆ onBeforePublish()

onBeforePublish ( $cid,
  $publish 
)
protected

The event which runs before a record is (un)published

Paramètres
integer | array&$cidThe PK IDs of the records being (un)published
integer$publish1 to publish, 0 to unpublish
Renvoie
boolean True to allow the (un)publish to proceed

Référencé par publish().

◆ onBeforeReorder()

onBeforeReorder (   $where = '')
protected

The event which runs before reordering a table

Paramètres
string$whereThe WHERE clause of the SQL query to run on reordering (record filter)
Renvoie
boolean True to allow reordering

Référencé par reorder().

◆ onBeforeReset()

onBeforeReset ( )
protected

The even which runs before the object is reset to its default values.

Renvoie
boolean True to allow the reset to complete

Référencé par reset().

◆ onBeforeStore()

onBeforeStore (   $updateNulls)
protected

The event which runs before storing (saving) data to the database

Paramètres
boolean$updateNullsShould nulls be saved as nulls (true) or just skipped over (false)?
Renvoie
boolean True to allow saving

Référencé par store().

◆ publish()

publish (   $cid = null,
  $publish = 1,
  $user_id = 0 
)

Publish or unpublish records

Paramètres
integer | array$cidThe primary key value(s) of the item(s) to publish/unpublish
integer$publish1 to publish an item, 0 to unpublish
integer$user_idThe user ID of the user (un)publishing the item.
Renvoie
boolean True on success, false on failure (e.g. record is locked)

Références $_tbl_key, $query, checkin(), getColumnAlias(), getKnownFields(), onBeforePublish(), FOFUtilsObject\setError(), et FOFUtilsArray\toInteger().

◆ removeKnownField()

removeKnownField (   $field)

Remove a field from the known fields array

Paramètres
string$fieldThe name of the field to remove
Renvoie
void

Références $field.

◆ reorder()

reorder (   $where = '')

Change the ordering of the records of the table

Paramètres
string$whereThe WHERE clause of the SQL used to fetch the order
Renvoie
boolean True is successful
Exceptions
UnexpectedValueException

Références $_tbl_key, $i, $query, $row, $rows, getColumnAlias(), getKnownFields(), onAfterReorder(), et onBeforeReorder().

◆ reset()

reset ( )

Method to reset class properties to the defaults set in the class definition. It will ignore the primary key as well as any private class properties.

Renvoie
void

Références $fields, getQueryJoinFields(), getTableFields(), onAfterReset(), et onBeforeReset().

Référencé par __construct(), copy(), et load().

◆ save()

save (   $src,
  $orderingFilter = '',
  $ignore = '' 
)

Method to provide a shortcut to binding, checking and storing a FOFTable 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 FOFTable instance for the property specified.

Paramètres
mixed$srcAn associative array or object to bind to the FOFTable instance.
string$orderingFilterFilter for the order updating
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Renvoie
boolean True on success.

◆ setAssetKey()

setAssetKey (   $assetKey)

This method sets the asset key for the items of this table. Obviously, it is only meant to be used when you have a table with an asset field.

Paramètres
string$assetKeyThe name of the asset key to use
Renvoie
void

◆ setAssetsTracked()

setAssetsTracked (   $state)

Method to manually set this record as ACL asset or not. We have to do this since the automatic check is made in the constructor, but here we can't set any alias. So, even if you have an alias for asset_id, it wouldn't be reconized and assets won't be tracked.

Paramètres
$state

◆ setColumnAlias()

setColumnAlias (   $column,
  $columnAlias 
)

Method to register a column alias for a "special" column.

Paramètres
string$columnThe "special" column (ie ordering)
string$columnAliasThe real column name (ie foo_ordering)
Renvoie
void

◆ setConfig()

setConfig ( array  $config)

◆ setDBO()

setDBO (   $db)

Method to set the FOFDatabaseDriver object.

Paramètres
FOFDatabaseDriver$dbA FOFDatabaseDriver object to be used by the table object.
Renvoie
boolean True on success.

◆ setHasTags()

setHasTags (   $newState = false)

Sets the has tags switch state

Paramètres
bool$newState

Références true.

◆ setInput()

setInput ( FOFInput  $input)

Replace the input object of this table with the provided FOFInput object

Paramètres
FOFInput$inputThe new input object
Renvoie
void

◆ setKnownFields()

setKnownFields (   $fields,
  $initialise = false 
)

Replace the entire known fields array

Paramètres
array$fieldsA simple array of known field names
boolean$initialiseShould we initialise variables to null?
Renvoie
void

Références $field, $fields, et null.

Référencé par __construct().

◆ setQueryJoin()

setQueryJoin (   $query)

Sets the query with joins to other tables

Paramètres
FOFDatabaseQuery$queryThe JOIN query to use
Renvoie
void

◆ setRules()

setRules (   $input)

Method to set rules for the record.

Paramètres
mixed$inputA JAccessRules object, JSON string, or array.
Renvoie
void

◆ setSkipChecks()

setSkipChecks (   $skip)

Sets fields to be skipped from automatic checks.

Paramètres
array/string$skip Fields to be skipped by automatic checks
Renvoie
void

◆ setTableAlias()

setTableAlias (   $string)

◆ setTablePrefix()

setTablePrefix (   $prefix)

Set the class prefix

Paramètres
string$prefixThe prefix

Références $prefix.

◆ setTriggerEvents()

setTriggerEvents (   $newState = false)

Sets the events trigger switch state

Paramètres
boolean$newStateThe new state of the switch (what else could it be?)
Renvoie
void

Références true.

◆ store()

store (   $updateNulls = false)

Method to store a row in the database from the FOFTable instance properties. If a primary key value is set the row with that primary key value will be updated with the instance property values. If no primary key value is set a new row will be inserted into the database with the properties from the FOFTable instance.

Paramètres
boolean$updateNullsTrue to update fields even if they are null.
Renvoie
boolean True on success.

While the documentation for update/insertObject and execute() say they return a boolean, not all of the implemtnations. Depending on the version of J! and the specific driver, they may return a database object, or boolean, or a mix, or toss an exception. So try/catch, and test for false.

Références $_tbl_key, $fields, $key, _unlock(), bind(), getKnownFields(), getTableFields(), null, onAfterStore(), onBeforeStore(), et FOFUtilsObject\setError().

Référencé par copy().

◆ toCSV()

toCSV (   $separator = ',')

Export the item as a CSV line

Paramètres
string$separatorCSV separator. Tip: use "\t" to get a TSV file instead.
Renvoie
string The CSV line

Références $separator, et getKnownFields().

Documentation des champs

◆ $_assetKey

$_assetKey = ''
protected

◆ $_autoChecks

$_autoChecks = false
protected

◆ $_columnAlias

$_columnAlias = array()
protected

◆ $_configProviderKey

$_configProviderKey = ''
protected

◆ $_db

$_db
protected

Référencé par canDelete().

◆ $_has_tags

$_has_tags = false
protected

Référencé par hasTags().

◆ $_includePaths

$_includePaths = array()
staticprotected

◆ $_locked

$_locked = false
protected

◆ $_queryJoin

$_queryJoin = null
protected

◆ $_relations

$_relations = null
protected

◆ $_rules

$_rules
protected

◆ $_skipChecks

$_skipChecks = array()
protected

◆ $_tableAlias

$_tableAlias = false
protected

◆ $_tableExists

$_tableExists = true
protected

◆ $_tablePrefix

$_tablePrefix = ''
protected

◆ $_tbl

$_tbl = ''
protected

Référencé par getTableFields().

◆ $_tbl_key

$_tbl_key = ''
protected

◆ $_trackAssets

$_trackAssets = false
protected

◆ $_trigger_events

$_trigger_events = false
protected

Référencé par getTriggerEvents().

◆ $config

$config = array()
protected

◆ $configProvider

$configProvider = null
protected

Référencé par getAnInstance().

◆ $contentType

$contentType = null
protected

◆ $default_behaviors

$default_behaviors = array('tags', 'assets')
protected

Référencé par __construct().

◆ $input

$input = null
protected

◆ $instances

$instances = array()
staticprotected

◆ $knownFields

$knownFields = array()
protected

Référencé par getKnownFields().

◆ $tableCache

$tableCache = array()
staticprotected

Référencé par getTableFields().

◆ $tableDispatcher

$tableDispatcher = null
protected

◆ $tableFieldCache

$tableFieldCache = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :