JTableInterface

Table class interface.

since

3.2

package

Joomla.Libraries

Methods

bind

Method to bind an associative array or object to the JTableInterface instance.

bind(mixed $src, mixed $ignore = array()) : boolean

This method only binds properties that are publicly accessible and optionally takes an array of properties to ignore when binding.

since

3.2

throws

\UnexpectedValueException

Arguments

$src

mixedAn associative array or object to bind to the JTableInterface instance.

$ignore

mixedAn optional array or space separated list of properties to ignore while binding.

Response

booleanTrue on success.

check

Method to perform sanity checks on the JTableInterface instance properties to ensure they are safe to store in the database.

check() : boolean

Implementations of this interface should use this method to make sure the data they are storing in the database is safe and as expected before storage.

since

3.2

Response

booleanTrue if the instance is sane and able to be stored in the database.

delete

Method to delete a record.

delete(mixed $pk = null) : boolean
since

3.2

throws

\UnexpectedValueException

Arguments

$pk

mixedAn optional primary key value to delete. If not set the instance property value is used.

Response

booleanTrue on success.

getDbo

Method to get the JDatabaseDriver object.

getDbo() : \JDatabaseDriver
since

3.2

Response

\JDatabaseDriverThe internal database driver object.

getKeyName

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

getKeyName() : string
since

3.2

Response

stringThe name of the primary key for the table.

load

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

load(mixed $keys = null, boolean $reset = true) : boolean
since

3.2

throws

\RuntimeException

\UnexpectedValueException

Arguments

$keys

mixedAn 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

booleanTrue to reset the default values before loading the new row.

Response

booleanTrue if successful. False if row not found.

reset

Method to reset class properties to the defaults set in the class definition.

reset() : void

It will ignore the primary key as well as any private class properties.

since

3.2

store

Method to store a row in the database from the JTableInterface instance properties.

store(boolean $updateNulls = false) : boolean

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 JTableInterface instance.

since

3.2

Arguments

$updateNulls

booleanTrue to update fields even if they are null.

Response

booleanTrue on success.