\JTable
Abstract Table class
Parent class to all tables.
Synopsis
class JTable
extends JObject
implements
JObservableInterface
{
- // members
- private $_includePaths;
- protected $_tbl;
- protected $_tbl_key;
- protected $_tbl_keys;
- protected JDatabaseDriver $_db;
- protected $_trackAssets;
- protected JAccessRules $_rules;
- protected $_locked;
- protected $_autoincrement;
- protected JObserverUpdater $_observers;
- // Inherited members from JObject
- protected $_errors;
- // methods
- public void __construct()
- public void attachObserver()
- public JTableObserver|null getObserverOfClass()
- public mixed getFields()
- public static mixed getInstance()
- public static array addIncludePath()
- protected string _getAssetName()
- protected string _getAssetTitle()
- protected integer _getAssetParentId()
- public void appendPrimaryKeys()
- public string getTableName()
- public mixed getKeyName()
- public JDatabaseDriver getDbo()
- public boolean setDBO()
- public void setRules()
- public JAccessRules getRules()
- public void reset()
- public boolean bind()
- public boolean load()
- public boolean check()
- public boolean store()
- public boolean save()
- public boolean delete()
- public boolean checkOut()
- public boolean checkIn()
- public boolean hasPrimaryKey()
- public boolean hit()
- public boolean isCheckedOut()
- public mixed getNextOrder()
- public array getPrimaryKey()
- public mixed reorder()
- public mixed move()
- public boolean publish()
- protected boolean _lock()
- protected boolean _unlock()
- // 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
Extends
Extended by
- NestedTable
- TableDbTestComposite
- ContactTableContact
- TemplatesTableStyle
- NewsfeedsTableNewsfeed
- RedirectTableLink
- UsersTableNote
- CategoriesTableCategory
- ContentTableFeatured
- FinderTableLink
- FinderTableMap
- FinderTableFilter
- WeblinksTableWeblink
- MessagesTableMessage
- MenusTableMenu
- TagsTableTag
- BannersTableClient
- BannersTableBanner
- JTableContent
- JTableCategory
- JTableMenuType
- JTableModule
- JTableMenu
- JTableSession
- JTableLanguage
- JTableNested
- JTableUpdate
- JTableUsergroup
- JTableAsset
- JTableExtension
- JTableViewlevel
- JTableUser
- JTableContenttype
- JTableCorecontent
- JTableContenthistory
- JTableUcm
Implements
Members
private
- $_includePaths
—
array
Include paths for searching for JTable classes.
protected
- $_autoincrement
—
boolean
Indicates that the primary keys autoincrement. - $_db
—
JDatabaseDriver
JDatabaseDriver object. - $_errors
—
array
An array of error messages or Exception objects. - $_locked
—
boolean
Indicator that the tables have been locked. - $_observers
—
JObserverUpdater
Generic observers for this JTable (Used e.g. for tags Processing) - $_rules
—
JAccessRules
The rules associated with this record. - $_tbl
—
string
Name of the database table to model. - $_tbl_key
—
string
Name of the primary key field in the table. - $_tbl_keys
—
array
Name of the primary key fields in the table. - $_trackAssets
—
boolean
Should rows be tracked as ACL assets?
Methods
protected
- _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.
- _lock() — Method to lock the database table for writing.
- _unlock() — Method to unlock the database table for writing.
public
- __construct() — Object constructor to set table and key fields. In most cases this will be overridden by child classes to explicitly set the table and key fields for a particular database table.
- addIncludePath() — Add a filesystem path where JTable should search for table class files.
- appendPrimaryKeys() — Method to append the primary keys for this table to a query.
- attachObserver() — Implement JObservableInterface: Adds an observer to this instance.
- bind() — 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.
- check() — Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. Child classes should override this method to make sure the data they are storing in the database is safe and as expected before storage.
- checkIn() — Method to check a row in if the necessary properties/fields exist. Checking a row in will allow other users the ability to edit the row.
- checkOut() — Method to check a row out if the necessary properties/fields exist. To prevent race conditions while editing rows in a database, a row can be checked out if the fields 'checked_out' and 'checked_out_time' are available.
- delete() — Method to delete a row from the database table by primary key value.
- getDbo() — Method to get the JDatabaseDriver object.
- getFields() — Get the columns from database table.
- getInstance() — 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 JTable::addIncludePath().
- getKeyName() — Method to get the primary key field name for the table.
- getNextOrder() — Method to get the next ordering value for a group of rows defined by an SQL WHERE clause.
- getObserverOfClass() — Gets the instance of the observer of class $observerClass
- getPrimaryKey() — Get the primary key values for this table using passed in values as a default.
- getRules() — Method to get the rules for the record.
- getTableName() — Method to get the database table name for the class.
- hasPrimaryKey() — Validate that the primary key has been set.
- hit() — Method to increment the hits for a row if the necessary property/field exists.
- isCheckedOut() — Method to determine if a row is checked out and therefore uneditable by a user. If the row is checked out by the same user, then it is considered not checked out -- as the user can still edit it.
- load() — Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
- move() — Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause.
- publish() — Method to set the publishing state for a row or list of rows in the database table. The method respects checked out rows by other users and will attempt to checkin rows that it can after adjustments are made.
- reorder() — Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
- 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 (except $_errors).
- save() — 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.
- setDBO() — Method to set the JDatabaseDriver object.
- setRules() — Method to set rules for the record.
- store() — Method to store a row in the database from the JTable instance properties.
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.