Class JTable. Joomla jtable
JTable *Документация по Joomla 3.0.2
Joomla.Platform\JTable
libraries/joomla/table/table.php at line 25 JObject└─JTable All Known Subclasses: Joomla.Administrator\BannersTableBanner Joomla.Administrator\BannersTableClient Joomla.Administrator\ContactTableContact Joomla.Administrator\ContentTableFeatured Joomla.Administrator\FinderTableFilter Joomla.Administrator\FinderTableLink Joomla.Administrator\FinderTableMap Joomla.Legacy\JTableContent JTableExtension JTableLanguage Joomla.Legacy\JTableMenuType Joomla.Legacy\JTableModule JTableNested Joomla.Legacy\JTableSession JTableUpdate JTableUser JTableUsergroup JTableViewlevel Joomla.Administrator\MessagesTableMessage Joomla.Administrator\NewsfeedsTableNewsfeed Joomla.Administrator\RedirectTableLink Joomla.Administrator\TemplatesTableStyle Joomla.Administrator\UsersTableNote Joomla.Administrator\WeblinksTableWeblinkpublic abstract class JTableextends JObject
Subpackage: Table See Also: http://docs.joomla.org/JTable Since: 11.1 Tutorial: Joomla.Platform/jtable.clsprotected JDatabaseDriver | $_db JDatabaseDriver object. |
private static array | $_includePaths Include paths for searching for JTable classes. |
protected boolean | $_locked Indicator that the tables have been locked. |
protected JAccessRules A JAccessRules object. | $_rules The rules associated with this record. |
protected string | $_tbl Name of the database table to model. |
protected string | $_tbl_key Name of the primary key field in the table. |
protected boolean | $_trackAssets Should rows be tracked as ACL assets? |
_errors |
void | __construct(string table, string key, JDatabaseDriver db, mixed properties) Object constructor to set table and key fields. |
mixed | getFields() Get the columns from database table. |
static mixed | getInstance(string type, string prefix, array config) Static method to get an instance of a JTable class if it can be found in the table include paths. |
static array | addIncludePath(mixed path) Add a filesystem path where JTable should search for table class files. |
protected string | _getAssetName() Method to compute the default name of the asset. |
protected string | _getAssetTitle() Method to return the title to use for the asset table. |
protected integer | _getAssetParentId(JTable table, integer id) Method to get the parent asset under which to register this one. |
string | getTableName() Method to get the database table name for the class. |
string | getKeyName() Method to get the primary key field name for the table. |
JDatabaseDriver | getDbo() Method to get the JDatabaseDriver object. |
boolean | setDBO(JDatabaseDriver db) Method to set the JDatabaseDriver object. |
void | setRules(mixed input) Method to set rules for the record. |
JAccessRules | getRules() Method to get the rules for the record. |
void | reset() Method to reset class properties to the defaults set in the class definition. |
boolean | bind(mixed src, mixed ignore) 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. |
boolean | load(mixed keys, boolean reset) Method to load a row from the database by primary key and bind the fields to the JTable instance properties. |
boolean | check() Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. |
boolean | store(boolean updateNulls) Method to store a row in the database from the JTable instance properties. |
boolean | save(mixed src, string orderingFilter, mixed ignore) Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. |
boolean | delete(mixed pk) Method to delete a row from the database table by primary key value. |
boolean | checkOut(integer userId, mixed pk) Method to check a row out if the necessary properties/fields exist. |
boolean | checkIn(mixed pk) Method to check a row in if the necessary properties/fields exist. |
boolean | hit(mixed pk) Method to increment the hits for a row if the necessary property/field exists. |
boolean | isCheckedOut(integer with, integer against) Method to determine if a row is checked out and therefore uneditable by a user. |
mixed | getNextOrder(string where) Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. |
mixed | reorder(string where) Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause. |
mixed | move(integer delta, string where) Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. |
boolean | publish(mixed pks, integer state, integer userId) Method to set the publishing state for a row or list of rows in the database table. |
protected boolean | _lock() Method to lock the database table for writing. |
protected boolean | _unlock() Method to unlock the database table for writing. |
Field Detail
libraries/joomla/table/table.php at line 57_db
protected JDatabaseDriver $_dbJDatabaseDriver object.
Since: 11.1 libraries/joomla/table/table.php at line 33_includePaths
private static array $_includePaths = array()Include paths for searching for JTable classes.
Since: 12.1 libraries/joomla/table/table.php at line 81_locked
protected boolean $_locked = false_rules
protected JAccessRules A JAccessRules object. $_rulesThe rules associated with this record.
Since: 11.1 libraries/joomla/table/table.php at line 41_tbl
protected string $_tbl = ''Name of the database table to model.
Since: 11.1 libraries/joomla/table/table.php at line 49_tbl_key
protected string $_tbl_key = ''Name of the primary key field in the table.
Since: 11.1 libraries/joomla/table/table.php at line 65_trackAssets
protected boolean $_trackAssets = falseShould rows be tracked as ACL assets?
Since: 11.1Constructor Detail
libraries/joomla/table/table.php at line 94__construct
public void __construct(string table, string key, JDatabaseDriver db, mixed properties)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.
Parameters: table - Name of the table to model. key - Name of the primary key field in the table. db - JDatabaseDriver object. Since: 11.1
Method Detail
libraries/joomla/table/table.php at line 136 getFields
public mixed getFields()Get the columns from database table.
Returns: An array of the field names, or false if an error occurs. Since: 11.1 Throws: UnexpectedValueException libraries/joomla/table/table.php at line 170getInstance
public static mixed getInstance(string type, string prefix, array config)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().
Parameters: type - The type (name) of the JTable class to get an instance of. prefix - An optional prefix for the table class name. config - An optional array of configuration values for the JTable object. Returns: A JTable object if found or boolean false if one could not be found. See Also: http://docs.joomla.org/JTable/getInstance Since: 11.1 libraries/joomla/table/table.php at line 219addIncludePath
public static array addIncludePath(mixed path)Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.
Parameters: path - A filesystem path or array of filesystem paths to add. Returns: An array of filesystem paths to find JTable classes in. See Also: http://docs.joomla.org/JTable/addIncludePath Since: 11.1 libraries/joomla/table/table.php at line 256
_getAssetName
protected string _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.
Since: 11.1 libraries/joomla/table/table.php at line 274_getAssetTitle
protected string _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.
Returns: The string to use as the title in the asset table. See Also: http://docs.joomla.org/JTable/getAssetTitle Since: 11.1 libraries/joomla/table/table.php at line 293_getAssetParentId
protected integer _getAssetParentId(JTable table, integer id)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.
getTableName
public string getTableName() libraries/joomla/table/table.php at line 328getKeyName
public string getKeyName() libraries/joomla/table/table.php at line 341getDbo
public JDatabaseDriver getDbo() libraries/joomla/table/table.php at line 356setDBO
public boolean setDBO(JDatabaseDriver db)Method to set the JDatabaseDriver object.
Parameters: db - A JDatabaseDriver object to be used by the table object. Returns: True on success. See Also: http://docs.joomla.org/JTable/setDBO Since: 11.1 libraries/joomla/table/table.php at line 372setRules
public void setRules(mixed input)Method to set rules for the record.
Parameters: input - A JAccessRules object, JSON string, or array. Since: 11.1 libraries/joomla/table/table.php at line 391
getRules
public JAccessRules getRules() Method to get the rules for the record.
Returns: object Since: 11.1 libraries/joomla/table/table.php at line 406reset
public void 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.
See Also: http://docs.joomla.org/JTable/reset Since: 11.1 libraries/joomla/table/table.php at line 433bind
public boolean bind(mixed src, mixed ignore)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: src - An associative array or object to bind to the JTable instance. ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/bind Since: 11.1 Throws: UnexpectedValueException libraries/joomla/table/table.php at line 484load
public boolean load(mixed keys, boolean reset)Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
check
public boolean 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.
Returns: True if the instance is sane and able to be stored in the database. See Also: http://docs.joomla.org/JTable/check Since: 11.1 libraries/joomla/table/table.php at line 572store
public boolean store(boolean updateNulls)Method to store a row in the database from the JTable 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 JTable instance.
Parameters: updateNulls - True to update fields even if they are null. Returns: True on success. See Also: http://docs.joomla.org/JTable/store Since: 11.1 libraries/joomla/table/table.php at line 692save
public boolean save(mixed src, string orderingFilter, mixed 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: src - An associative array or object to bind to the JTable instance. orderingFilter - Filter for the order updating ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/save Since: 11.1 libraries/joomla/table/table.php at line 742delete
public boolean delete(mixed pk)Method to delete a row from the database table by primary key value.
Parameters: pk - An optional primary key value to delete. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/delete Since: 11.1 Throws: UnexpectedValueException libraries/joomla/table/table.php at line 806checkOut
public boolean checkOut(integer userId, mixed pk)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. While a row is checked out, any attempt to store the row by a user other than the one who checked the row out should be held until the row is checked in again.
Parameters: userId - The Id of the user checking out the row. pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkOut Since: 11.1 libraries/joomla/table/table.php at line 853checkIn
public boolean checkIn(mixed pk)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.
Parameters: pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkIn Since: 11.1 libraries/joomla/table/table.php at line 898hit
public boolean hit(mixed pk)Method to increment the hits for a row if the necessary property/field exists.
Parameters: pk - An optional primary key value to increment. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/hit Since: 11.1 libraries/joomla/table/table.php at line 944isCheckedOut
public boolean isCheckedOut(integer with, integer against)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.
Parameters: with - The userid to preform the match with, if an item is checked out by this user the function will return false. against - The userid to perform the match against when the function is used as a static function. Returns: True if checked out. See Also: http://docs.joomla.org/JTable/isCheckedOut Since: 11.1 libraries/joomla/table/table.php at line 977getNextOrder
public mixed getNextOrder(string 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.
Parameters: where - WHERE clause to use for selecting the MAX(ordering) for the table. Returns: Boolean false an failure or the next ordering value as an integer. See Also: http://docs.joomla.org/JTable/getNextOrder Since: 11.1 libraries/joomla/table/table.php at line 1013reorder
public mixed reorder(string where)Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
Parameters: where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean True on success. See Also: http://docs.joomla.org/JTable/reorder Since: 11.1 libraries/joomla/table/table.php at line 1076move
public mixed move(integer delta, string 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.
Parameters: delta - The direction and magnitude to move the row in the ordering sequence. where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean True on success. See Also: http://docs.joomla.org/JTable/move Since: 11.1 Throws: UnexpectedValueException libraries/joomla/table/table.php at line 1172publish
public boolean publish(mixed pks, integer state, integer userId)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.
Parameters: pks - An optional array of primary key values to update. If not set the instance property value is used. state - The publishing state. eg. [0 = unpublished, 1 = published] userId - The user id of the user performing the operation. Returns: True on success; false if $pks is empty. See Also: http://docs.joomla.org/JTable/publish Since: 11.1 libraries/joomla/table/table.php at line 1245_lock
protected boolean _lock()Method to lock the database table for writing.
Returns: True on success. Since: 11.1 Throws: RuntimeException libraries/joomla/table/table.php at line 1260_unlock
protected boolean _unlock()Method to unlock the database table for writing.
Returns: True on success. Since: 11.1 Вернуться к записям по теме Joomla.ya.samposebe.ru
JTable (Документация по Joomla 1.7)
Вернуться к записям по теме Joomla.Joomla.Platform\JTable
libraries/joomla/database/table.php at line 23 JObject└─JTable All Known Subclasses: Joomla.Administrator\BannersTableBanner Joomla.Administrator\BannersTableClient Joomla.Administrator\ContactTableContact Joomla.Administrator\ContentTableFeatured JTableContent JTableExtension JTableLanguage JTableMenuType JTableModule JTableNested JTableSession JTableUpdate JTableUser JTableUsergroup JTableViewlevel Joomla.Administrator\MessagesTableMessage Joomla.Administrator\NewsfeedsTableNewsfeed Joomla.Administrator\RedirectTableLink Joomla.Administrator\TemplatesTableStyle Joomla.Administrator\WeblinksTableWeblinkpublic abstract class JTableextends JObject
Subpackage: Table Since: 11.1 Tutorial: Joomla.Platform/jtable.cls See Also: http://docs.joomla.org/JTableprotected object | $_db JDatabase connector object. |
protected boolean | $_locked Indicator that the tables have been locked. |
protected JRules A JRules object. | $_rules The rules associated with this record. |
protected string | $_tbl Name of the database table to model. |
protected string | $_tbl_key Name of the primary key field in the table. |
protected boolean | $_trackAssets Should rows be tracked as ACL assets? |
_errors |
JObject | __construct(mixed table, mixed key, mixed db, string Name, object JDatabase, mixed properties) Object constructor to set table and key fields. |
mixed | getFields() Get the columns from database table. |
static mixed | getInstance(string The, array An, mixed type, str prefix, mixed config) Static method to get an instance of a JTable class if it can be found in the table include paths. |
static array | addIncludePath(mixed A, mixed path) Add a filesystem path where JTable should search for table class files. |
protected static string | _getAssetName() Method to compute the default name of the asset. |
protected string | _getAssetTitle() Method to return the title to use for the asset table. |
protected integer | _getAssetParentId(JTable table, integer id) Method to get the parent asset under which to register this one. |
string | getTableName() Method to get the database table name for the class. |
string | getKeyName() Method to get the primary key field name for the table. |
object | getDbo() Method to get the JDatabase connector object. |
boolean | setDBO(object &$db, mixed db) Method to set the JDatabase connector object. |
void | setRules(mixed input) Method to set rules for the record. |
JRules | getRules() Method to get the rules for the record. |
void | reset() Method to reset class properties to the defaults set in the class definition. |
boolean | bind(mixed src, mixed ignore) 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. |
boolean | load(mixed keys, boolean reset) Method to load a row from the database by primary key and bind the fields to the JTable instance properties. |
boolean | check() Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. |
boolean | store(boolean updateNulls) Method to store a row in the database from the JTable instance properties. |
boolean | save(mixed src, string orderingFilter, mixed ignore) Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. |
boolean | delete(mixed pk) Method to delete a row from the database table by primary key value. |
boolean | checkOut(integer userId, mixed pk) Method to check a row out if the necessary properties/fields exist. |
boolean | checkIn(mixed pk) Method to check a row in if the necessary properties/fields exist. |
boolean | hit(mixed pk) Method to increment the hits for a row if the necessary property/field exists. |
boolean | isCheckedOut(integer with, integer against) Method to determine if a row is checked out and therefore uneditable by a user. |
mixed | getNextOrder(string where) Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. |
mixed | reorder(string where) Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause. |
mixed | move(integer delta, string where) Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. |
boolean | publish(mixed pk, integer state, integer userId, mixed pks) Method to set the publishing state for a row or list of rows in the database table. |
boolean | canDelete(mixed pk, array joins) Generic check for whether dependancies exist for this object in the database schemaCan be overloaded/supplemented by the child class |
string | toXML(boolean mapKeysToText) Method to export the JTable instance properties to an XML string. |
protected boolean | _lock() Method to lock the database table for writing. |
protected boolean | _unlock() Method to unlock the database table for writing. |
__construct, __toString, def, get, getError, getErrors, getProperties, set, setError, setProperties, toString |
Field Detail
libraries/joomla/database/table.php at line 47_db
protected object $_dbJDatabase connector object.
Since: 11.1 libraries/joomla/database/table.php at line 70_locked
protected boolean $_locked = falseIndicator that the tables have been locked.
Since: 11.1 libraries/joomla/database/table.php at line 62_rules
protected JRules A JRules object. $_rulesThe rules associated with this record.
libraries/joomla/database/table.php at line 31_tbl
protected string $_tbl = ''Name of the database table to model.
Since: 11.1 libraries/joomla/database/table.php at line 39_tbl_key
protected string $_tbl_key = ''Name of the primary key field in the table.
Since: 11.1 libraries/joomla/database/table.php at line 55_trackAssets
protected boolean $_trackAssets = falseShould rows be tracked as ACL assets?
Since: 11.1Constructor Detail
libraries/joomla/database/table.php at line 83__construct
public JObject __construct(mixed table, mixed key, mixed db, string Name, object JDatabase, mixed properties)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.
Parameters: Name - of the table to model. Name - of the primary key field in the table. JDatabase - connector object. Since: 11.1Method Detail
libraries/joomla/database/table.php at line 118getFields
public mixed getFields()Get the columns from database table.
Returns: An array of the field names, or false if an error occurs. libraries/joomla/database/table.php at line 150getInstance
public static mixed getInstance(string The, array An, mixed type, str prefix, mixed config)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().
Parameters: The - type (name) of the JTable class to get an instance of. An - optional prefix for the table class name. An - optional array of configuration values for the JTable object. Returns: A JTable object if found or boolean false if one could not be found. Since: 11.1 See Also: http://docs.joomla.org/JTable/getInstance libraries/joomla/database/table.php at line 196addIncludePath
public static array addIncludePath(mixed A, mixed path)Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.
Parameters: A - filesystem path or array of filesystem paths to add. Returns: An array of filesystem paths to find JTable classes in. See Also: http://docs.joomla.org/JTable/addIncludePath Since: 11.1 libraries/joomla/database/table.php at line 234_getAssetName
protected static string _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.
Since: 11.1 libraries/joomla/database/table.php at line 252_getAssetTitle
protected string _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 woud just return $this->title or $this->name or whatever is being used for the primary name of the row. If this method is not overriden, the asset name is used.
Returns: The string to use as the title in the asset table. See Also: http://docs.joomla.org/JTable/getAssetTitle Since: 11.1 libraries/joomla/database/table.php at line 270_getAssetParentId
protected integer _getAssetParentId(JTable table, integer id)Method to get the parent asset under which to register this one. By default, all assets are registered to the ROOT node with ID 1. The extended class can define a table and id to lookup. If the asset does not exist it will be created.
Parameters: table - A JTable object for the asset parent. id - Id to look up Since: 11.1 libraries/joomla/database/table.php at line 289getTableName
public string getTableName() libraries/joomla/database/table.php at line 302getKeyName
public string getKeyName() libraries/joomla/database/table.php at line 315getDbo
public object getDbo() libraries/joomla/database/table.php at line 330setDBO
public boolean setDBO(object &$db, mixed db)Method to set the JDatabase connector object.
Parameters: &$db - A JDatabase connector object to be used by the table object. Returns: True on success. See Also: http://docs.joomla.org/JTable/setDBO Since: 11.1 libraries/joomla/database/table.php at line 349setRules
public void setRules(mixed input)Method to set rules for the record.
Parameters: input - A JRules object, JSON string, or array. Since: 11.1 libraries/joomla/database/table.php at line 366getRules
public JRules getRules()Method to get the rules for the record.
Returns: object Since: 11.1 libraries/joomla/database/table.php at line 381reset
public void 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.
See Also: http://docs.joomla.org/JTable/reset Since: 11.1 libraries/joomla/database/table.php at line 407bind
public boolean bind(mixed src, mixed ignore)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: src - An associative array or object to bind to the JTable instance. ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/bind Since: 11.1 libraries/joomla/database/table.php at line 453load
public boolean load(mixed keys, boolean reset)Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
Parameters: keys - An 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. reset - True to reset the default values before loading the new row. Returns: True if successful. False if row not found or on error (internal error state set in that case). See Also: http://docs.joomla.org/JTable/load Since: 11.1 libraries/joomla/database/table.php at line 526check
public boolean 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.
Returns: True if the instance is sane and able to be stored in the database. See Also: http://docs.joomla.org/JTable/check Since: 11.1 libraries/joomla/database/table.php at line 545store
public boolean store(boolean updateNulls)Method to store a row in the database from the JTable 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 JTable instance.
Parameters: updateNulls - True to update fields even if they are null. Returns: True on success. See Also: http://docs.joomla.org/JTable/store Since: 11.1 libraries/joomla/database/table.php at line 656save
public boolean save(mixed src, string orderingFilter, mixed 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: src - An associative array or object to bind to the JTable instance. orderingFilter - Filter for the order updating ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/save Since: 11.1 libraries/joomla/database/table.php at line 701delete
public boolean delete(mixed pk)Method to delete a row from the database table by primary key value.
Parameters: pk - An optional primary key value to delete. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/delete Since: 11.1 libraries/joomla/database/table.php at line 767checkOut
public boolean checkOut(integer userId, mixed pk)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. While a row is checked out, any attempt to store the row by a user other than the one who checked the row out should be held until the row is checked in again.
Parameters: userId - The Id of the user checking out the row. pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkOut Since: 11.1 libraries/joomla/database/table.php at line 821checkIn
public boolean checkIn(mixed pk)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.
Parameters: pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkIn Since: 11.1 libraries/joomla/database/table.php at line 872hit
public boolean hit(mixed pk)Method to increment the hits for a row if the necessary property/field exists.
Parameters: pk - An optional primary key value to increment. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/hit Since: 11.1 libraries/joomla/database/table.php at line 924isCheckedOut
public boolean isCheckedOut(integer with, integer against)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.
Parameters: with - The userid to preform the match with, if an item is checked out by this user the function will return false. against - The userid to perform the match against when the function is used as a static function. Returns: True if checked out. See Also: http://docs.joomla.org/JTable/isCheckedOut Since: 11.1 Todo: This either needs to be static or not. libraries/joomla/database/table.php at line 959getNextOrder
public mixed getNextOrder(string 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.
Parameters: where - WHERE clause to use for selecting the MAX(ordering) for the table. Returns: Boolean false an failure or the next ordering value as an integer. See Also: http://docs.joomla.org/JTable/getNextOrder Since: 11.1 libraries/joomla/database/table.php at line 1006reorder
public mixed reorder(string where)Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
Parameters: where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean true on success. See Also: http://docs.joomla.org/JTable/reorder Since: 11.1 libraries/joomla/database/table.php at line 1086move
public mixed move(integer delta, string 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.
Parameters: delta - The direction and magnitude to move the row in the ordering sequence. where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean true on success. See Also: http://docs.joomla.org/JTable/move Since: 11.1 libraries/joomla/database/table.php at line 1199publish
public boolean publish(mixed pk, integer state, integer userId, mixed pks)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.
Parameters: pk - An optional array of primary key values to update. If not set the instance property value is used. state - The publishing state. eg. [0 = unpublished, 1 = published] userId - The user id of the user performing the operation. Returns: True on success. See Also: http://docs.joomla.org/JTable/publish Since: 11.1 libraries/joomla/database/table.php at line 1284canDelete
public boolean canDelete(mixed pk, array joins)Generic check for whether dependancies exist for this object in the database schema
Can be overloaded/supplemented by the child class
Parameters: pk - An optional primary key value check the row for. If not set the instance property value is used. joins - An optional array to compiles standard joins formatted like: [label => 'Label', name => 'table name' , idfield => 'field', joinfield => 'field'] Returns: True on success. Deprecated: 12.1 See Also: http://docs.joomla.org/JTable/canDelete Since: 11.1 libraries/joomla/database/table.php at line 1360toXML
public string toXML(boolean mapKeysToText)Method to export the JTable instance properties to an XML string.
Parameters: mapKeysToText - True to map foreign keys to text values. Returns: XML string representation of the instance. Deprecated: 12.1 See Also: http://docs.joomla.org/JTable/toXML Since: 11.1 libraries/joomla/database/table.php at line 1394_lock
protected boolean _lock()Method to lock the database table for writing.
Returns: True on success. Since: 11.1 libraries/joomla/database/table.php at line 1419_unlock
protected boolean _unlock()Method to unlock the database table for writing.
Returns: True on success. Since: 11.1 Вернуться к записям по теме Joomla.ya.samposebe.ru
JTable (Документация по Joomla 2.5.4)
Вернуться к записям по теме Joomla.Joomla.Platform\JTable
libraries/joomla/database/table.php at line 23 JObject└─JTable All Known Subclasses: Joomla.Administrator\BannersTableBanner Joomla.Administrator\BannersTableClient Joomla.Administrator\ContactTableContact Joomla.Administrator\ContentTableFeatured Joomla.Administrator\FinderTableFilter Joomla.Administrator\FinderTableLink Joomla.Administrator\FinderTableMap JTableContent JTableExtension JTableLanguage JTableMenuType JTableModule JTableNested JTableSession JTableUpdate JTableUser JTableUsergroup JTableViewlevel Joomla.Administrator\MessagesTableMessage Joomla.Administrator\NewsfeedsTableNewsfeed Joomla.Administrator\RedirectTableLink Joomla.Administrator\TemplatesTableStyle Joomla.Administrator\UsersTableNote Joomla.Administrator\WeblinksTableWeblinkpublic abstract class JTableextends JObject
Subpackage: Table See Also: http://docs.joomla.org/JTable Since: 11.1 Tutorial: Joomla.Platform/jtable.clsprotected JDatabase | $_db JDatabase connector object. |
protected boolean | $_locked Indicator that the tables have been locked. |
protected JAccessRules A JAccessRules object. | $_rules The rules associated with this record. |
protected string | $_tbl Name of the database table to model. |
protected string | $_tbl_key Name of the primary key field in the table. |
protected boolean | $_trackAssets Should rows be tracked as ACL assets? |
_errors |
void | __construct(string table, string key, mixed db, JDatabase &$db, mixed properties) Object constructor to set table and key fields. |
mixed | getFields() Get the columns from database table. |
static mixed | getInstance(string type, string prefix, array config) Static method to get an instance of a JTable class if it can be found in the table include paths. |
static array | addIncludePath(mixed path) Add a filesystem path where JTable should search for table class files. |
protected static string | _getAssetName() Method to compute the default name of the asset. |
protected string | _getAssetTitle() Method to return the title to use for the asset table. |
protected integer | _getAssetParentId(JTable table, integer id) Method to get the parent asset under which to register this one. |
string | getTableName() Method to get the database table name for the class. |
string | getKeyName() Method to get the primary key field name for the table. |
JDatabase | getDbo() Method to get the JDatabase connector object. |
boolean | setDBO(object &$db, mixed db) Method to set the JDatabase connector object. |
void | setRules(mixed input) Method to set rules for the record. |
JAccessRules | getRules() Method to get the rules for the record. |
void | reset() Method to reset class properties to the defaults set in the class definition. |
boolean | bind(mixed src, mixed ignore) 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. |
boolean | load(mixed keys, boolean reset) Method to load a row from the database by primary key and bind the fields to the JTable instance properties. |
boolean | check() Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. |
boolean | store(boolean updateNulls) Method to store a row in the database from the JTable instance properties. |
boolean | save(mixed src, string orderingFilter, mixed ignore) Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. |
boolean | delete(mixed pk) Method to delete a row from the database table by primary key value. |
boolean | checkOut(integer userId, mixed pk) Method to check a row out if the necessary properties/fields exist. |
boolean | checkIn(mixed pk) Method to check a row in if the necessary properties/fields exist. |
boolean | hit(mixed pk) Method to increment the hits for a row if the necessary property/field exists. |
boolean | isCheckedOut(integer with, integer against) Method to determine if a row is checked out and therefore uneditable by a user. |
mixed | getNextOrder(string where) Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. |
mixed | reorder(string where) Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause. |
mixed | move(integer delta, string where) Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. |
boolean | publish(mixed pks, integer state, integer userId) Method to set the publishing state for a row or list of rows in the database table. |
boolean | canDelete(mixed pk, array joins) Generic check for whether dependencies exist for this object in the database schemaCan be overloaded/supplemented by the child class |
string | toXML(boolean mapKeysToText) Method to export the JTable instance properties to an XML string. |
protected boolean | _lock() Method to lock the database table for writing. |
protected boolean | _unlock() Method to unlock the database table for writing. |
__construct, __toString, def, get, getError, getErrors, getProperties, set, setError, setProperties, toString |
Field Detail
libraries/joomla/database/table.php at line 47_db
protected JDatabase $_dbJDatabase connector object.
Since: 11.1 libraries/joomla/database/table.php at line 71_locked
protected boolean $_locked = falseIndicator that the tables have been locked.
Since: 11.1 libraries/joomla/database/table.php at line 63_rules
protected JAccessRules A JAccessRules object. $_rulesThe rules associated with this record.
Since: 11.1 libraries/joomla/database/table.php at line 31_tbl
protected string $_tbl = ''Name of the database table to model.
Since: 11.1 libraries/joomla/database/table.php at line 39_tbl_key
protected string $_tbl_key = ''Name of the primary key field in the table.
Since: 11.1 libraries/joomla/database/table.php at line 55_trackAssets
protected boolean $_trackAssets = falseShould rows be tracked as ACL assets?
Since: 11.1Constructor Detail
libraries/joomla/database/table.php at line 84__construct
public void __construct(string table, string key, mixed db, JDatabase &$db, mixed properties)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.
Parameters: table - Name of the table to model. key - Name of the primary key field in the table. &$db - JDatabase connector object. Since: 11.1Method Detail
libraries/joomla/database/table.php at line 124getFields
public mixed getFields()Get the columns from database table.
Returns: An array of the field names, or false if an error occurs. Since: 11.1 libraries/joomla/database/table.php at line 160getInstance
public static mixed getInstance(string type, string prefix, array config)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().
Parameters: type - The type (name) of the JTable class to get an instance of. prefix - An optional prefix for the table class name. config - An optional array of configuration values for the JTable object. Returns: A JTable object if found or boolean false if one could not be found. See Also: http://docs.joomla.org/JTable/getInstance Since: 11.1 libraries/joomla/database/table.php at line 210addIncludePath
public static array addIncludePath(mixed path)Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.
Parameters: path - A filesystem path or array of filesystem paths to add. Returns: An array of filesystem paths to find JTable classes in. See Also: http://docs.joomla.org/JTable/addIncludePath Since: 11.1 libraries/joomla/database/table.php at line 250_getAssetName
protected static string _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.
Since: 11.1 libraries/joomla/database/table.php at line 268_getAssetTitle
protected string _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.
Returns: The string to use as the title in the asset table. See Also: http://docs.joomla.org/JTable/getAssetTitle Since: 11.1 libraries/joomla/database/table.php at line 286_getAssetParentId
protected integer _getAssetParentId(JTable table, integer id)Method to get the parent asset under which to register this one. By default, all assets are registered to the ROOT node with ID 1. The extended class can define a table and id to lookup. If the asset does not exist it will be created.
Parameters: table - A JTable object for the asset parent. id - Id to look up Since: 11.1 libraries/joomla/database/table.php at line 306getTableName
public string getTableName() libraries/joomla/database/table.php at line 319getKeyName
public string getKeyName() libraries/joomla/database/table.php at line 332getDbo
public JDatabase getDbo() libraries/joomla/database/table.php at line 347setDBO
public boolean setDBO(object &$db, mixed db)Method to set the JDatabase connector object.
Parameters: &$db - A JDatabase connector object to be used by the table object. Returns: True on success. See Also: http://docs.joomla.org/JTable/setDBO Since: 11.1 libraries/joomla/database/table.php at line 369setRules
public void setRules(mixed input)Method to set rules for the record.
Parameters: input - A JAccessRules object, JSON string, or array. Since: 11.1 libraries/joomla/database/table.php at line 388getRules
public JAccessRules getRules()Method to get the rules for the record.
Returns: object Since: 11.1 libraries/joomla/database/table.php at line 403reset
public void 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.
See Also: http://docs.joomla.org/JTable/reset Since: 11.1 libraries/joomla/database/table.php at line 429bind
public boolean bind(mixed src, mixed ignore)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: src - An associative array or object to bind to the JTable instance. ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/bind Since: 11.1 libraries/joomla/database/table.php at line 480load
public boolean load(mixed keys, boolean reset)Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
Parameters: keys - An 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. reset - True to reset the default values before loading the new row. Returns: True if successful. False if row not found or on error (internal error state set in that case). See Also: http://docs.joomla.org/JTable/load Since: 11.1 libraries/joomla/database/table.php at line 571check
public boolean 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.
Returns: True if the instance is sane and able to be stored in the database. See Also: http://docs.joomla.org/JTable/check Since: 11.1 libraries/joomla/database/table.php at line 590store
public boolean store(boolean updateNulls)Method to store a row in the database from the JTable 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 JTable instance.
Parameters: updateNulls - True to update fields even if they are null. Returns: True on success. See Also: http://docs.joomla.org/JTable/store Since: 11.1 libraries/joomla/database/table.php at line 713save
public boolean save(mixed src, string orderingFilter, mixed 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: src - An associative array or object to bind to the JTable instance. orderingFilter - Filter for the order updating ignore - An optional array or space separated list of properties to ignore while binding. Returns: True on success. See Also: http://docs.joomla.org/JTable/save Since: 11.1 libraries/joomla/database/table.php at line 762delete
public boolean delete(mixed pk)Method to delete a row from the database table by primary key value.
Parameters: pk - An optional primary key value to delete. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/delete Since: 11.1 libraries/joomla/database/table.php at line 834checkOut
public boolean checkOut(integer userId, mixed pk)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. While a row is checked out, any attempt to store the row by a user other than the one who checked the row out should be held until the row is checked in again.
Parameters: userId - The Id of the user checking out the row. pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkOut Since: 11.1 libraries/joomla/database/table.php at line 890checkIn
public boolean checkIn(mixed pk)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.
Parameters: pk - An optional primary key value to check out. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/checkIn Since: 11.1 libraries/joomla/database/table.php at line 943hit
public boolean hit(mixed pk)Method to increment the hits for a row if the necessary property/field exists.
Parameters: pk - An optional primary key value to increment. If not set the instance property value is used. Returns: True on success. See Also: http://docs.joomla.org/JTable/hit Since: 11.1 libraries/joomla/database/table.php at line 998isCheckedOut
public boolean isCheckedOut(integer with, integer against)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.
Parameters: with - The userid to preform the match with, if an item is checked out by this user the function will return false. against - The userid to perform the match against when the function is used as a static function. Returns: True if checked out. See Also: http://docs.joomla.org/JTable/isCheckedOut Since: 11.1 Todo: This either needs to be static or not. libraries/joomla/database/table.php at line 1031getNextOrder
public mixed getNextOrder(string 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.
Parameters: where - WHERE clause to use for selecting the MAX(ordering) for the table. Returns: Boolean false an failure or the next ordering value as an integer. See Also: http://docs.joomla.org/JTable/getNextOrder Since: 11.1 libraries/joomla/database/table.php at line 1078reorder
public mixed reorder(string where)Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
Parameters: where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean true on success. See Also: http://docs.joomla.org/JTable/reorder Since: 11.1 libraries/joomla/database/table.php at line 1162move
public mixed move(integer delta, string 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.
Parameters: delta - The direction and magnitude to move the row in the ordering sequence. where - WHERE clause to use for limiting the selection of rows to compact the ordering values. Returns: Boolean true on success. See Also: http://docs.joomla.org/JTable/move Since: 11.1 libraries/joomla/database/table.php at line 1284publish
public boolean publish(mixed pks, integer state, integer userId)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.
Parameters: pks - An optional array of primary key values to update. If not set the instance property value is used. state - The publishing state. eg. [0 = unpublished, 1 = published] userId - The user id of the user performing the operation. Returns: True on success. See Also: http://docs.joomla.org/JTable/publish Since: 11.1 libraries/joomla/database/table.php at line 1377canDelete
public boolean canDelete(mixed pk, array joins)Generic check for whether dependencies exist for this object in the database schema
Can be overloaded/supplemented by the child class
Parameters: pk - An optional primary key value check the row for. If not set the instance property value is used. joins - An optional array to compiles standard joins formatted like: [label => 'Label', name => 'table name' , idfield => 'field', joinfield => 'field'] Returns: True on success. Deprecated: 12.1 See Also: http://docs.joomla.org/JTable/canDelete Since: 11.1 libraries/joomla/database/table.php at line 1463toXML
public string toXML(boolean mapKeysToText)Method to export the JTable instance properties to an XML string.
Parameters: mapKeysToText - True to map foreign keys to text values. Returns: XML string representation of the instance. Deprecated: 12.1 See Also: http://docs.joomla.org/JTable/toXML Since: 11.1 libraries/joomla/database/table.php at line 1502_lock
protected boolean _lock()Method to lock the database table for writing.
Returns: True on success. Since: 11.1 Throws: JDatabaseException libraries/joomla/database/table.php at line 1517_unlock
protected boolean _unlock()Method to unlock the database table for writing.
Returns: True on success. Since: 11.1 Вернуться к записям по теме Joomla.ya.samposebe.ru
Вернуться к записям по теме Joomla. Joomla.Platform\JTableCategory libraries/joomla/database/table/category.php at line 21 JObject└─JTable└─JTableNested└─JTableCategorypublic class JTableCategoryextends JTableNested Subpackage: Table Since: 11.1 Tutorial: Joomla.Platform/jtable.cls See Also: http://docs.joomla.org/JTable
Constructor Detaillibraries/joomla/database/table/category.php at line 32__constructpublic JTableCategory __construct(database db, mixed properties, mixed table, mixed key, string Name, object JDatabase)Constructor Parameters: db - A database connector object Since: 11.1Method Detaillibraries/joomla/database/table/category.php at line 48_getAssetNameprotected string _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. Since: 11.1 libraries/joomla/database/table/category.php at line 61_getAssetTitleprotected string _getAssetTitle() libraries/joomla/database/table/category.php at line 76_getAssetParentIdprotected integer _getAssetParentId(JTable table, integer id)Get the parent asset id for the record Parameters: table - A JTable object for the asset parent. id - The id for the asset Returns: The id of the asset's parent Since: 11.1 libraries/joomla/database/table/category.php at line 127checkpublic boolean check() libraries/joomla/database/table/category.php at line 158bindpublic mixed bind(array array, string ignore, mixed src)Overloaded bind function. Parameters: array - named array ignore - An optional array or space separated list of properties to ignore while binding. Returns: Null if operation was satisfactory, otherwise returns an error See Also: JTable:bind Since: 11.1 See Also: http://docs.joomla.org/JTable/bind libraries/joomla/database/table/category.php at line 190storepublic boolean store(boolean updateNulls, boolean True)Overriden JTable::store to set created/modified and user id. Parameters: updateNulls - True to update fields even if they are null. Returns: True on success. Since: 11.1 See Also: http://docs.joomla.org/JTable/store Вернуться к записям по теме Joomla. |
ya.samposebe.ru