JTableMenu
class JTableMenu extends JTableNested
Menu table
Properties
integer | $parent_id | Object property holding the primary key of the parent node. Provides adjacency list data for nodes. | from JTableNested |
integer | $level | Object property holding the depth level of the node in the tree. | from JTableNested |
integer | $lft | Object property holding the left value of the node for managing its placement in the nested sets tree. | from JTableNested |
integer | $rgt | Object property holding the right value of the node for managing its placement in the nested sets tree. | from JTableNested |
string | $alias | Object property holding the alias of this node used to constuct the full text path, forward-slash delimited. | from JTableNested |
Methods
Constructor
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
Method to load a row from the database by primary key and bind the fields to the JTable instance properties.
Overloaded check function
Overloaded store function
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 node and, optionally, its child nodes from the table.
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 node or list of nodes in the database table. The method respects rows checked out by other users and will attempt to checkin rows that it can after adjustments are made. The method will not allow you to set a publishing state higher than any ancestor node and will not allow you to set a publishing state on a node with a checked out child.
Generic check for whether dependancies exist for this object in the database schema
Method to export the JTable instance properties to an XML string.
Method to get an array of nodes from a given node to its root.
Method to get a node and all its child nodes.
Method to determine if a node is a leaf node in the tree (has no children).
Method to set the location of a node in the tree object. This method does not save the new location to the database, but will set it in the object so that when the node is stored it will be stored in the new location.
Method to move a node and its children to a new location in the tree.
Method to move a node one position to the left in the same level.
Method to move a node one position to the right in the same level.
Method to recursively rebuild the whole nested set tree.
Method to rebuild the node's path field from the alias values of the nodes from the current node to the root node of the tree.
Method to update order of table rows
Details
at line 32
JObject
__construct(object $db)
Constructor
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 52
boolean
bind(array $array, mixed $ignore = '')
Overloaded bind function
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.
at line 89
boolean
check()
Overloaded check function
at line 137
boolean
store(boolean $updateNulls = false)
Overloaded store function
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 JTableNested at line 526
boolean
delete(mixed $pk = null, boolean $children = true)
Method to delete a node and, optionally, its child nodes from the table.
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 JTableNested at line 261
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 JTableNested at line 859
boolean
publish($pks = null, $state = 1, $userId)
Method to set the publishing state for a node or list of nodes in the database table. The method respects rows checked out by other users and will attempt to checkin rows that it can after adjustments are made. The method will not allow you to set a publishing state higher than any ancestor node and will not allow you to set a publishing state on a node with a checked out child.
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.
in JTable at line 1453
getErrorMsg()
in JTableNested at line 108
debug(integer $level)
Sets the debug level on or off
in JTableNested at line 124
mixed
getPath(integer $pk = null, boolean $diagnostic = false)
Method to get an array of nodes from a given node to its root.
in JTableNested at line 164
mixed
getTree(integer $pk = null, boolean $diagnostic = false)
Method to get a node and all its child nodes.
in JTableNested at line 202
boolean
isLeaf(integer $pk = null)
Method to determine if a node is a leaf node in the tree (has no children).
in JTableNested at line 231
boolean
setLocation(integer $referenceId, string $position = 'after')
Method to set the location of a node in the tree object. This method does not save the new location to the database, but will set it in the object so that when the node is stored it will be stored in the new location.
in JTableNested at line 310
boolean
moveByReference(integer $referenceId, string $position = 'after', integer $pk = null)
Method to move a node and its children to a new location in the tree.
in JTableNested at line 993
boolean
orderUp(integer $pk)
Method to move a node one position to the left in the same level.
in JTableNested at line 1089
boolean
orderDown(integer $pk)
Method to move a node one position to the right in the same level.
in JTableNested at line 1183
mixed
getRootId()
Gets the ID of the root item in the tree
in JTableNested at line 1278
integer
rebuild(integer $parentId = null, integer $leftId, integer $level, string $path = '')
Method to recursively rebuild the whole nested set tree.
in JTableNested at line 1361
boolean
rebuildPath(integer $pk = null)
Method to rebuild the node's path field from the alias values of the nodes from the current node to the root node of the tree.
in JTableNested at line 1421
integer
saveorder(array $idArray = null, array $lft_array = null)
Method to update order of table rows