UknowvaTable
class UknowvaTable extends JTable
TABLE
Methods
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.
Sets a default value if not alreay assigned
Returns a property of the object or the default value if the property is not set.
Returns an associative array of object properties.
Get the most recent error message.
Modifies a property of the object, creating it if it does not already exist.
Set the object properties based on a named array/hash.
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().
Add a filesystem path where JTable should search for table class files.
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.
Overloaded bind function to pre-process the params.
Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
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.
Method to store a row in the database from the JTable instance properties.
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.
Method to delete a row from the database table by primary key value.
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 'checkedout' and 'checkedout_time' are available.
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.
Method to increment the hits for a row if the necessary property/field exists.
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.
Method to get the next ordering value for a group of rows defined by an SQL WHERE clause.
Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause.
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.
Generic check for whether dependancies exist for this object in the database schema
Method to export the JTable instance properties to an XML string.
No description
No description
Details
at line 13
JObject
__construct($name, string $key = 'id', object $db = null)
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.
in JObject at line 56
string
__toString()
Magic method to convert the object to a string gracefully.
in JObject at line 70
mixed
def(string $property, mixed $default = null)
Sets a default value if not alreay assigned
in JObject at line 88
mixed
get(string $property, mixed $default = null)
Returns a property of the object or the default value if the property is not set.
in JObject at line 107
array
getProperties(boolean $public = true)
Returns an associative array of object properties.
in JObject at line 133
string
getError(integer $i = null, boolean $toString = true)
Get the most recent error message.
in JObject at line 165
array
getErrors()
Return all errors, if any.
in JObject at line 180
mixed
set(string $property, mixed $value = null)
Modifies a property of the object, creating it if it does not already exist.
in JObject at line 198
boolean
setProperties(mixed $properties)
Set the object properties based on a named array/hash.
in JObject at line 222
void
setError(string $error)
Add an error message.
in JObject at line 235
string
toString()
deprecated
deprecated
in JTable at line 126
mixed
getFields()
Get the columns from database table.
in JTable at line 158
static mixed
getInstance(string $type, string $prefix = 'JTable', array $config = array())
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().
in JTable at line 204
static array
addIncludePath(mixed $path = null)
Add a filesystem path where JTable should search for table class files.
You may either pass a string or an array of paths.
in JTable at line 297
string
getTableName()
Method to get the database table name for the class.
in JTable at line 310
string
getKeyName()
Method to get the primary key field name for the table.
in JTable at line 323
object
getDbo()
Method to get the JDatabase connector object.
in JTable at line 338
boolean
setDBO(object $db)
Method to set the JDatabase connector object.
in JTable at line 357
setRules(mixed $input)
Method to set rules for the record.
in JTable at line 389
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.
at line 28
boolean
bind($array, mixed $ignore = '')
Overloaded bind function to pre-process the params.
in JTable at line 461
boolean
load(mixed $keys = null, boolean $reset = true)
Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
in JTable at line 539
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.
in JTable at line 558
boolean
store(boolean $updateNulls = false)
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.
in JTable at line 672
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.
in JTable at line 717
boolean
delete(mixed $pk = null)
Method to delete a row from the database table by primary key value.
in JTable at line 783
boolean
checkOut(integer $userId, mixed $pk = null)
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 'checkedout' and 'checkedout_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.
in JTable at line 837
boolean
checkIn(mixed $pk = null)
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.
in JTable at line 888
boolean
hit(mixed $pk = null)
Method to increment the hits for a row if the necessary property/field exists.
in JTable at line 940
boolean
isCheckedOut(integer $with, integer $against = null)
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.
in JTable at line 975
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.
in JTable at line 1022
mixed
reorder(string $where = '')
Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
in JTable at line 1102
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.
in JTable at line 1215
boolean
publish($pks = null, $state = 1, $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.
in JTable at line 1300
boolean
canDelete(mixed $pk = null, array $joins = null)
deprecated
deprecated
Generic check for whether dependancies exist for this object in the database schema
Can be overloaded/supplemented by the child class
in JTable at line 1376
string
toXML(boolean $mapKeysToText = false)
deprecated
deprecated
Method to export the JTable instance properties to an XML string.