\FOFTable
FrameworkOnFramework Table class. The Table is one part controller, one part model and one part data adapter. It's supposed to handle operations for single records.
Synopsis
class FOFTable
extends JObject
implements
JTableInterface
{
- // members
- private $instances;
- private $_includePaths;
- protected $config;
- protected $_tbl;
- protected $_tbl_key;
- protected JDatabaseDriver $_db;
- protected $_trackAssets;
- protected $_has_tags;
- protected JAccessRules $_rules;
- protected $_locked;
- protected $_trigger_events;
- protected $_tableAlias;
- protected $_columnAlias;
- protected $_autoChecks;
- protected $_skipChecks;
- protected $_tableExists;
- protected $_assetKey;
- protected FOFInput $input;
- protected JDatabaseQuery $_queryJoin;
- protected $_tablePrefix;
- protected $knownFields;
- protected $tableFieldCache;
- protected $tableCache;
- protected FOFConfigProvider $configProvider;
- protected FOFTableDispatcherBehavior $tableDispatcher;
- protected $default_behaviors;
- // Inherited members from JObject
- protected $_errors;
- // methods
- public static FOFTable getInstance()
- public static FOFTable getAnInstance()
- public static bool forceInstance()
- public void __construct()
- public void setKnownFields()
- public array getKnownFields()
- public void addKnownField()
- public void removeKnownField()
- public boolean addBehavior()
- public void setTriggerEvents()
- public boolean getTriggerEvents()
- public bool hasTags()
- public void setHasTags()
- public void setTablePrefix()
- public void setSkipChecks()
- public boolean load()
- public boolean check()
- public void reset()
- public boolean canDelete()
- public boolean bind()
- public boolean store()
- public mixed move()
- public boolean reorder()
- public boolean checkout()
- public boolean checkin()
- public boolean isCheckedOut()
- public boolean copy()
- public boolean publish()
- public boolean delete()
- public boolean hit()
- public string toCSV()
- public array getData()
- public string getCSVHeader()
- public mixed getTableFields()
- public void getTableAlias()
- public void setTableAlias()
- public string getColumnAlias()
- public void setColumnAlias()
- public JDatabaseQuery getQueryJoin()
- public void setQueryJoin()
- protected array getQueryJoinFields()
- protected array normalizeSelectFields()
- protected bool isQuoted()
- protected boolean onBeforeBind()
- protected void onAfterLoad()
- protected boolean onBeforeStore()
- protected boolean onAfterBind()
- protected boolean onAfterStore()
- protected boolean onBeforeMove()
- protected boolean onAfterMove()
- protected boolean onBeforeReorder()
- protected boolean onAfterReorder()
- protected boolean onBeforeDelete()
- protected boolean onAfterDelete()
- protected boolean onBeforeHit()
- protected boolean onAfterHit()
- protected boolean onBeforeCopy()
- protected boolean onAfterCopy()
- protected boolean onBeforePublish()
- protected boolean onAfterReset()
- protected boolean onBeforeReset()
- public void setInput()
- public mixed getFields()
- public static array addIncludePath()
- protected bool|JTableAsset getAsset()
- public string getAssetName()
- public string getAssetKey()
- public string getAssetTitle()
- public integer getAssetParentId()
- public void setAssetKey()
- public string getTableName()
- public string getKeyName()
- public JDatabaseDriver getDbo()
- public boolean setDBO()
- public void setRules()
- public JAccessRules getRules()
- public boolean isAssetsTracked()
- public void setAssetsTracked()
- public boolean save()
- public mixed getNextOrder()
- protected boolean _lock()
- protected boolean _unlock()
- public void setConfig()
- public string getContentType()
- // Inherited methods from JObject
- public void __construct()
- public string __toString()
- public mixed def()
- public mixed get()
- public array getProperties()
- public string getError()
- public array getErrors()
- public mixed set()
- public boolean setProperties()
- public void setError()
Hierarchy
Tasks
Tasks
Line | Task |
---|---|
1646 | Should we notify the user that we had a problem with this record? |
1659 | Should we notify the user that we had a problem with this record? |
1662 | Should we notify the user that we had a problem with this record? |
1737 | Rewrite this statment using IN. Check if it work in SQLServer and PostgreSQL |
1769 | should we check for its return value? |
1822 | Check for a database error. |
Members
private
- $_includePaths
—
array
Include paths for searching for FOFTable classes. - $instances
—
array
Cache array for instances
protected
- $_assetKey
—
string
The asset key for items in this table. It's usually something in the com_example.viewname format. They asset name will be this key appended with the item's ID, e.g. com_example.viewname.123 - $_autoChecks
—
boolean
If set to true, it enabled automatic checks on fields based on columns properties - $_columnAlias
—
array
Array with alias for "special" columns such as ordering, hits etc etc - $_db
—
JDatabaseDriver
JDatabaseDriver object. - $_errors
—
array
An array of error messages or Exception objects. - $_locked
—
boolean
Indicator that the tables have been locked. - $_queryJoin
—
JDatabaseQuery
Extended query including joins with other tables - $_rules
—
JAccessRules
The rules associated with this record. - $_skipChecks
—
array
Array with fields that should be skipped by automatic checks - $_tableAlias
—
string
Table alias used in queries - $_tableExists
—
boolean
Does the table actually exist? We need that to avoid PHP notices on table-less views. - $_tablePrefix
—
string
The prefix for the table class - $_tbl
—
string
Name of the database table to model. - $_tbl_key
—
string
Name of the primary key field in the table. - $_trackAssets
—
boolean
Should rows be tracked as ACL assets? - $_trigger_events
—
boolean
If this is set to true, it triggers automatically plugin events for table actions - $config
—
array
The configuration parameters array - $configProvider
—
FOFConfigProvider
An instance of FOFConfigProvider to provision configuration overrides - $default_behaviors
—
array
List of default behaviors to apply to the table - $input
—
FOFInput
The input data - $knownFields
—
array
The known fields for this table - $tableCache
—
array
A list of tables in the database - $tableDispatcher
—
FOFTableDispatcherBehavior
FOFTableDispatcherBehavior for dealing with extra behaviors - $tableFieldCache
—
array
A list of table fields, keyed per table
Methods
protected
- _lock() — Method to lock the database table for writing.
- _unlock() — Method to unlock the database table for writing.
- getAsset() — Loads the asset table related to this table.
- getQueryJoinFields() — Extracts the fields from the join query
- isQuoted() — Is the field quoted?
- normalizeSelectFields() — Normalizes the fields, returning an associative array with all the fields.
- onAfterBind() — The event which runs after binding data to the class
- onAfterCopy() — The even which runs after copying a record
- onAfterDelete() — The event which runs after deleting a record
- onAfterHit() — The event which runs after hitting a record
- onAfterLoad() — The event which runs after loading a record from the database
- onAfterMove() — The event which runs after moving a record
- onAfterReorder() — The event which runs after reordering a table
- onAfterReset() — The event which runs after the object is reset to its default values.
- onAfterStore() — The event which runs after storing (saving) data to the database
- onBeforeBind() — The event which runs before binding data to the table
- onBeforeCopy() — The even which runs before copying a record
- onBeforeDelete() — The event which runs before deleting a record
- onBeforeHit() — The event which runs before hitting a record
- onBeforeMove() — The event which runs before moving a record
- onBeforePublish() — The event which runs before a record is (un)published
- onBeforeReorder() — The event which runs before reordering a table
- onBeforeReset() — The even which runs before the object is reset to its default values.
- onBeforeStore() — The event which runs before storing (saving) data to the database
public
- __construct() — Class Constructor.
- addBehavior() — Adds a behavior to the table
- addIncludePath() — Add a filesystem path where FOFTable should search for table class files.
- addKnownField() — Add a field to the known fields array
- bind() — 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.
- canDelete() — Generic check for whether dependencies exist for this object in the db schema
- check() — Based on fields properties (nullable column), checks if the field is required or not
- checkin() — Check in (unlock) a record
- checkout() — Check out (lock) a record
- copy() — Copy (duplicate) one or more records
- delete() — Delete a record
- forceInstance() — Force an instance inside class cache. Setting arguments to null nukes all or part of the cache
- getAnInstance() — Returns a static object instance of a particular table type
- getAssetKey() — Method to compute the default name of the asset.
- getAssetName() — Method to compute the default name of the asset.
- getAssetParentId() — Method to get the parent asset under which to register this one.
- 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.
- getCSVHeader() — Get the header for exporting item list to CSV
- getColumnAlias() — 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.
- getContentType() — Get the content type for ucm
- getData() — Exports the table in array format
- getDbo() — Method to get the JDatabaseDriver object.
- getFields() — Get the columns from database table.
- getInstance() — Returns a static object instance of a particular table type
- getKeyName() — Method to get the primary key field name for the table.
- getKnownFields() — Get the known fields array
- getNextOrder() — Method to get the next ordering value for a group of rows defined by an SQL WHERE clause.
- getQueryJoin() — Get a JOIN query, used to join other tables
- getRules() — Method to get the rules for the record.
- getTableAlias()
- getTableFields() — Get the columns from a database table.
- getTableName() — Method to get the database table name for the class.
- getTriggerEvents() — Gets the events trigger switch state
- hasTags() — Gets the has tags switch state
- hit() — Register a hit on a record
- isAssetsTracked() — Method to check if the record is treated as an ACL asset
- isCheckedOut() — Is a record locked?
- load() — Method to load a row from the database by primary key and bind the fields to the FOFTable instance properties.
- move() — Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause.
- publish() — Publish or unpublish records
- removeKnownField() — Remove a field from the known fields array
- reorder() — Change the ordering of the records of the table
- 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.
- save() — 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.
- setAssetKey() — 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.
- setAssetsTracked() — Method to manually set this record as ACL asset or not.
- setColumnAlias() — Method to register a column alias for a "special" column.
- setConfig()
- setDBO() — Method to set the JDatabaseDriver object.
- setHasTags() — Sets the has tags switch state
- setInput() — Replace the input object of this table with the provided FOFInput object
- setKnownFields() — Replace the entire known fields array
- setQueryJoin() — Sets the query with joins to other tables
- setRules() — Method to set rules for the record.
- setSkipChecks() — Sets fields to be skipped from automatic checks.
- setTableAlias()
- setTablePrefix() — Set the class prefix
- setTriggerEvents() — Sets the events trigger switch state
- store() — Method to store a row in the database from the FOFTable instance properties.
- toCSV() — Export the item as a CSV line
Inherited from JObject
public
- __toString() — Magic method to convert the object to a string gracefully.
- def() — Sets a default value if not alreay assigned
- get() — Returns a property of the object or the default value if the property is not set.
- getError() — Get the most recent error message.
- getErrors() — Return all errors, if any.
- getProperties() — Returns an associative array of object properties.
- set() — Modifies a property of the object, creating it if it does not already exist.
- setError() — Add an error message.
- setProperties() — Set the object properties based on a named array/hash.