Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFTableNested
+ Graphe d'héritage de FOFTableNested:

Fonctions membres publiques

 __construct ($table, $key, &$db, $config=array())
 
 check ()
 
 reorder ($where='')
 
 move ($delta, $where='')
 
 create ($data)
 
 copy ($cid=null)
 
 reset ()
 
 insertAsRoot ()
 
 insertAsFirstChildOf (FOFTableNested &$parentNode)
 
 insertAsLastChildOf (FOFTableNested &$parentNode)
 
 insertAsChildOf (FOFTableNested &$parentNode)
 
 insertLeftOf (FOFTableNested &$siblingNode)
 
 insertRightOf (FOFTableNested &$siblingNode)
 
 insertAsSiblingOf (FOFTableNested &$siblingNode)
 
 moveLeft ()
 
 moveRight ()
 
 moveToLeftOf (FOFTableNested $siblingNode)
 
 moveToRightOf (FOFTableNested $siblingNode)
 
 makeNextSiblingOf (FOFTableNested $siblingNode)
 
 makeSiblingOf (FOFTableNested $siblingNode)
 
 makePreviousSiblingOf (FOFTableNested $siblingNode)
 
 makeFirstChildOf (FOFTableNested $parentNode)
 
 makeLastChildOf (FOFTableNested $parentNode)
 
 makeChildOf (FOFTableNested $parentNode)
 
 makeRoot ()
 
 getLevel ()
 
 getParent ()
 
 isRoot ()
 
 isLeaf ()
 
 isChild ()
 
 isDescendantOf (FOFTableNested $otherNode)
 
 isSelfOrDescendantOf (FOFTableNested $otherNode)
 
 isAncestorOf (FOFTableNested $otherNode)
 
 isSelfOrAncestorOf (FOFTableNested $otherNode)
 
 equals (FOFTableNested &$node)
 
 insideSubtree (FOFTableNested $otherNode)
 
 inSameScope (FOFTableNested $otherNode)
 
 withoutNode (FOFTableNested $node)
 
 getRoot ()
 
 getAncestorsAndSelf ()
 
 getAncestorsAndSelfWithoutRoot ()
 
 getAncestors ()
 
 getAncestorsWithoutRoot ()
 
 getSiblingsAndSelf ()
 
 getSiblings ()
 
 getLeaves ()
 
 getDescendantsAndSelf ()
 
 getDescendants ()
 
 getImmediateDescendants ()
 
 getNestedList ($column='title', $key=null, $seperator=' ')
 
 findByPath ($path)
 
 isValid ()
 
 rebuild ()
 
 whereRaw ($rawWhereClause)
 
 get ($limitstart=0, $limit=0)
 
- Fonctions membres publiques hérités de FOFTable
 __construct ($table, $key, &$db, $config=array())
 
 setKnownFields ($fields, $initialise=false)
 
 getKnownFields ()
 
 hasField ($fieldName)
 
 addKnownField ($field, $initialise=false)
 
 removeKnownField ($field)
 
 addBehavior ($name, $config=array())
 
 setTriggerEvents ($newState=false)
 
 getTriggerEvents ()
 
 hasTags ()
 
 setHasTags ($newState=false)
 
 setTablePrefix ($prefix)
 
 setSkipChecks ($skip)
 
 load ($keys=null, $reset=true)
 
 check ()
 
 reset ()
 
 getClone ()
 
 canDelete ($oid=null, $joins=null)
 
 bind ($src, $ignore=array())
 
 store ($updateNulls=false)
 
 move ($delta, $where='')
 
 reorder ($where='')
 
 checkout ($userId, $oid=null)
 
 checkin ($oid=null)
 
 isCheckedOut ($with=0, $unused_against=null)
 
 copy ($cid=null)
 
 publish ($cid=null, $publish=1, $user_id=0)
 
 delete ($oid=null)
 
 hit ($oid=null, $log=false)
 
 toCSV ($separator=',')
 
 getData ()
 
 getCSVHeader ($separator=',')
 
 getTableFields ($tableName=null)
 
 getTableAlias ()
 
 setTableAlias ($string)
 
 getColumnAlias ($column)
 
 setColumnAlias ($column, $columnAlias)
 
 getQueryJoin ($asReference=false)
 
 setQueryJoin ($query)
 
 setInput (FOFInput $input)
 
 getFields ()
 
 getAssetName ()
 
 getAssetKey ()
 
 getAssetTitle ()
 
 getAssetParentId ($table=null, $id=null)
 
 setAssetKey ($assetKey)
 
 getTableName ()
 
 getKeyName ()
 
 getId ()
 
 getDbo ()
 
 setDBO ($db)
 
 setRules ($input)
 
 getRules ()
 
 isAssetsTracked ()
 
 setAssetsTracked ($state)
 
 save ($src, $orderingFilter='', $ignore='')
 
 getNextOrder ($where='')
 
 setConfig (array $config)
 
 getContentType ()
 
 getRelations ()
 
 getConfigProvider ()
 
 getConfigProviderKey ()
 
 checkContentType ($alias=null)
 
- Fonctions membres publiques hérités de FOFUtilsObject
 __construct ($properties=null)
 
 __toString ()
 
 def ($property, $default=null)
 
 get ($property, $default=null)
 
 getProperties ($public=true)
 
 getError ($i=null, $toString=true)
 
 getErrors ()
 
 set ($property, $value=null)
 
 setProperties ($properties)
 
 setError ($error)
 

Fonctions membres protégées

 onAfterDelete ($oid)
 
 scopeAncestorsAndSelf ()
 
 scopeAncestors ()
 
 scopeSiblingsAndSelf ()
 
 scopeSiblings ()
 
 scopeLeaves ()
 
 scopeDescendantsAndSelf ()
 
 scopeDescendants ()
 
 scopeImmediateDescendants ()
 
 scopeWithoutSelf ()
 
 scopeWithoutRoot ()
 
 resetTreeCache ()
 
 buildQuery ()
 
- Fonctions membres protégées hérités de FOFTable
 getQueryJoinFields ()
 
 normalizeSelectFields ($fields)
 
 isQuoted ($column)
 
 onBeforeBind (&$from)
 
 onAfterLoad (&$result)
 
 onBeforeStore ($updateNulls)
 
 onAfterBind (&$src)
 
 onAfterStore ()
 
 onBeforeMove ($updateNulls)
 
 onAfterMove ()
 
 onBeforeReorder ($where='')
 
 onAfterReorder ()
 
 onBeforeDelete ($oid)
 
 onAfterDelete ($oid)
 
 onBeforeHit ($oid, $log)
 
 onAfterHit ($oid)
 
 onBeforeCopy ($oid)
 
 onAfterCopy ($oid)
 
 onBeforePublish (&$cid, $publish)
 
 onAfterReset ()
 
 onBeforeReset ()
 
 getAsset ()
 
 _lock ()
 
 _unlock ()
 
 getUcmCoreAlias ($alias, $null="null")
 

Attributs protégés

 $treeDepth = null
 
 $treeRoot = null
 
 $treeParent = null
 
 $treeNestedGet = false
 
 $whereClauses = array()
 
- Attributs protégés hérités de FOFTable
 $config = array()
 
 $_tbl = ''
 
 $_tbl_key = ''
 
 $_db
 
 $_trackAssets = false
 
 $_has_tags = false
 
 $_rules
 
 $_locked = false
 
 $_trigger_events = false
 
 $_tableAlias = false
 
 $_columnAlias = array()
 
 $_autoChecks = false
 
 $_skipChecks = array()
 
 $_tableExists = true
 
 $_assetKey = ''
 
 $input = null
 
 $_queryJoin = null
 
 $_tablePrefix = ''
 
 $knownFields = array()
 
 $configProvider = null
 
 $tableDispatcher = null
 
 $default_behaviors = array('tags', 'assets')
 
 $_relations = null
 
 $_configProviderKey = ''
 
 $contentType = null
 
- Attributs protégés hérités de FOFUtilsObject
 $_errors = array()
 

Membres hérités additionnels

- Fonctions membres publiques statiques hérités de FOFTable
static getInstance ($type, $prefix='JTable', $config=array())
 
static & getAnInstance ($type=null, $prefix='JTable', $config=array())
 
static forceInstance ($key=null, $instance=null)
 
static addIncludePath ($path=null)
 
- Attributs protégés statiques hérités de FOFTable
static $instances = array()
 
static $_includePaths = array()
 
static $tableFieldCache = array()
 
static $tableCache = array()
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $table,
  $key,
$db,
  $config = array() 
)

Public constructor. Overrides the parent constructor, making sure there are lft/rgt columns which make it compatible with nested sets.

Paramètres
string$tableName of the database table to model.
string$keyName of the primary key field in the table.
FOFDatabaseDriver&$dbDatabase driver
array$configThe configuration parameters array
Exceptions

Références $config, $db, et $key.

Documentation des fonctions membres

◆ buildQuery()

buildQuery ( )
protected

Builds the query for the get() method

Renvoie
FOFDatabaseQuery

Références $db, et $query.

◆ check()

check ( )

Overrides the automated table checks to handle the 'hash' column for faster searching

Renvoie
boolean

Références title, et FOFStringUtils\toSlug().

◆ copy()

copy (   $cid = null)

Makes a copy of the record, inserting it as the last child of the given node's parent.

Paramètres
integer | array$cidThe primary key value (or values) or the record(s) to copy. If null, the current record will be copied
Renvoie
self|FOFTableNested The last copied node

Références $item, et FOFUtilsArray\toInteger().

◆ create()

create (   $data)

Create a new record with the provided data. It is inserted as the last child of the current node's parent

Paramètres
array$dataThe data to use in the new record
Renvoie
static The new node

Références $data.

◆ equals()

equals ( FOFTableNested $node)

Is $node this very node?

Paramètres
FOFTableNested$node
Exceptions
RuntimeException
@return bool

Références FOFTable\getId().

◆ findByPath()

findByPath (   $path)

Locate a node from a given path, e.g. "/some/other/leaf"

Notes:

  • This will only work when you have a "slug" and a "hash" field in your table.
  • If the path starts with "/" we will use the root with lft=1. Otherwise the first component of the path is supposed to be the slug of the root node.
  • If the root node is not found you'll get null as the return value
  • You will also get null if any component of the path is not found
Paramètres
string$pathThe path to locate
Renvoie
FOFTableNested|null The found node or null if nothing is found

◆ get()

get (   $limitstart = 0,
  $limit = 0 
)

Returns a database iterator to retrieve records. Use the scope methods and the whereRaw method to define what exactly will be returned.

Paramètres
integer$limitstartHow many items to skip from the start, only when $overrideLimits = true
integer$limitHow many items to return, only when $overrideLimits = true
Renvoie
FOFDatabaseIterator The data collection

Références $db, $limit, $query, FOFDatabaseIterator\getIterator(), et null.

◆ getAncestors()

getAncestors ( )

Get all ancestors to this node but not the node itself. In other words it gets the path to the node, without the node itself.

Renvoie
FOFDatabaseIterator

◆ getAncestorsAndSelf()

getAncestorsAndSelf ( )

Get all ancestors to this node and the node itself. In other words it gets the full path to the node and the node itself.

Renvoie
FOFDatabaseIterator

◆ getAncestorsAndSelfWithoutRoot()

getAncestorsAndSelfWithoutRoot ( )

Get all ancestors to this node and the node itself, but not the root node. If you want to

Renvoie
FOFDatabaseIterator

◆ getAncestorsWithoutRoot()

getAncestorsWithoutRoot ( )

Get all ancestors to this node but not the node itself and its root.

Renvoie
FOFDatabaseIterator

◆ getDescendants()

getDescendants ( )

Get only our descendant (children) nodes, not ourselves.

Note: all descendant nodes, even descendants of our immediate descendants, will be returned.

Renvoie
FOFDatabaseIterator

◆ getDescendantsAndSelf()

getDescendantsAndSelf ( )

Get all descendant (children) nodes and ourselves.

Note: all descendant nodes, even descendants of our immediate descendants, will be returned.

Renvoie
FOFDatabaseIterator

◆ getImmediateDescendants()

getImmediateDescendants ( )

Get the immediate descendants (children). Unlike getDescendants it only goes one level deep into the tree structure. Descendants of descendant nodes will not be returned.

Renvoie
FOFDatabaseIterator

◆ getLeaves()

getLeaves ( )

Get all leaf nodes in the tree. You may want to use the scopes to narrow down the search in a specific subtree or path.

Renvoie
FOFDatabaseIterator

◆ getLevel()

getLevel ( )

Gets the level (depth) of this node in the tree. The result is cached in $this->treeDepth for faster retrieval.

Exceptions
RuntimeException
@return int|mixed

Références $db, et $query.

◆ getNestedList()

getNestedList (   $column = 'title',
  $key = null,
  $seperator = '  ' 
)

Returns a hashed array where each element's key is the value of the $key column (default: the ID column of the table) and its value is the value of the $column column (default: title). Each nesting level will have the value of the $column column prefixed by a number of $separator strings, as many as its nesting level (depth).

This is useful for creating HTML select elements showing the hierarchy in a human readable format.

Paramètres
string$column
null$key
string$seperator
Renvoie
array

Références $db, $key, $query, et $row.

◆ getParent()

getParent ( )

Returns the immediate parent of the current node

Exceptions
RuntimeException
@return FOFTableNested

Références $db, et $query.

◆ getRoot()

getRoot ( )

Returns the root node of the tree this node belongs to

Renvoie
self
Exceptions

Références $db, $query, $root, et null.

◆ getSiblings()

getSiblings ( )

Get all sibling nodes, except ourselves

Renvoie
FOFDatabaseIterator

◆ getSiblingsAndSelf()

getSiblingsAndSelf ( )

Get all sibling nodes, including ourselves

Renvoie
FOFDatabaseIterator

◆ inSameScope()

inSameScope ( FOFTableNested  $otherNode)

Returns true if both this node and $otherNode are root, leaf or child (same tree scope)

Paramètres
FOFTableNested$otherNode
Renvoie
bool

Références elseif, isChild(), isLeaf(), et isRoot().

◆ insertAsChildOf()

insertAsChildOf ( FOFTableNested $parentNode)

Alias for insertAsLastchildOf

Paramètres
FOFTableNested$parentNode
Renvoie
$this for chaining
Exceptions
Exception

◆ insertAsFirstChildOf()

insertAsFirstChildOf ( FOFTableNested $parentNode)

Insert the current node as the first (leftmost) child of a parent node.

WARNING: If it's an existing node it will be COPIED, not moved.

Paramètres
FOFTableNested$parentNodeThe node which will become our parent
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, $query, et null.

◆ insertAsLastChildOf()

insertAsLastChildOf ( FOFTableNested $parentNode)

Insert the current node as the last (rightmost) child of a parent node.

WARNING: If it's an existing node it will be COPIED, not moved.

Paramètres
FOFTableNested$parentNodeThe node which will become our parent
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, $query, et null.

◆ insertAsRoot()

insertAsRoot ( )

Insert the current node as a tree root. It is a good idea to never use this method, instead providing a root node in your schema installation and then sticking to only one root.

Renvoie
self

Références $db, et $query.

◆ insertAsSiblingOf()

insertAsSiblingOf ( FOFTableNested $siblingNode)

Alias for insertRightOf

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining

◆ insertLeftOf()

insertLeftOf ( FOFTableNested $siblingNode)

Insert the current node to the left of (before) a sibling node

WARNING: If it's an existing node it will be COPIED, not moved.

Paramètres
FOFTableNested$siblingNodeWe will be inserted before this node
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, et null.

◆ insertRightOf()

insertRightOf ( FOFTableNested $siblingNode)

Insert the current node to the right of (after) a sibling node

WARNING: If it's an existing node it will be COPIED, not moved.

Paramètres
FOFTableNested$siblingNodeWe will be inserted after this node
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, et null.

◆ insideSubtree()

insideSubtree ( FOFTableNested  $otherNode)

Alias for isDescendantOf

Paramètres
FOFTableNested$otherNode
Renvoie
bool

◆ isAncestorOf()

isAncestorOf ( FOFTableNested  $otherNode)

Returns true if we are an ancestor of $otherNode

Paramètres
FOFTableNested$otherNode
Renvoie
bool

Références isDescendantOf().

◆ isChild()

isChild ( )

Is this a child node (not root)?

Renvoie
bool

Référencé par inSameScope().

◆ isDescendantOf()

isDescendantOf ( FOFTableNested  $otherNode)

Returns true if we are a descendant of $otherNode

Paramètres
FOFTableNested$otherNode
Exceptions
RuntimeException
@return bool

Référencé par isAncestorOf().

◆ isLeaf()

isLeaf ( )

Is this a leaf node (a node without children)?

Exceptions
RuntimeException
@return bool

Référencé par inSameScope().

◆ isRoot()

isRoot ( )

Is this a top-level root node?

Renvoie
bool

Référencé par inSameScope().

◆ isSelfOrAncestorOf()

isSelfOrAncestorOf ( FOFTableNested  $otherNode)

Returns true if $otherNode is ourselves or we are an ancestor of $otherNode

Paramètres
FOFTableNested$otherNode
Renvoie
bool

Références isSelfOrDescendantOf().

◆ isSelfOrDescendantOf()

isSelfOrDescendantOf ( FOFTableNested  $otherNode)

Returns true if $otherNode is ourselves or if we are a descendant of $otherNode

Paramètres
FOFTableNested$otherNode
Exceptions
RuntimeException
@return bool

Référencé par isSelfOrAncestorOf().

◆ isValid()

isValid ( )

◆ makeChildOf()

makeChildOf ( FOFTableNested  $parentNode)

Alias for makeLastChildOf

Paramètres
FOFTableNested$parentNode
Renvoie
$this for chaining

◆ makeFirstChildOf()

makeFirstChildOf ( FOFTableNested  $parentNode)

Moves a node and its subtree as a the first (leftmost) child of $parentNode

Paramètres
FOFTableNested$parentNode
Renvoie
$this for chaining
Exceptions
Exception

Références $db, et $query.

◆ makeLastChildOf()

makeLastChildOf ( FOFTableNested  $parentNode)

Moves a node and its subtree as a the last (rightmost) child of $parentNode

Paramètres
FOFTableNested$parentNode
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, et $query.

◆ makeNextSiblingOf()

makeNextSiblingOf ( FOFTableNested  $siblingNode)

Alias for moveToRightOf

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining

◆ makePreviousSiblingOf()

makePreviousSiblingOf ( FOFTableNested  $siblingNode)

Alias for moveToLeftOf

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining

◆ makeRoot()

makeRoot ( )

Makes the current node a root (and moving its entire subtree along the way). This is achieved by moving the node to the right of its root node

Renvoie
$this for chaining

◆ makeSiblingOf()

makeSiblingOf ( FOFTableNested  $siblingNode)

Alias for makeNextSiblingOf

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining

◆ move()

move (   $delta,
  $where = '' 
)

Not supported in nested sets

Paramètres
integer$deltaIgnored
string$whereIgnored
Renvoie
void
Exceptions
RuntimeException

◆ moveLeft()

moveLeft ( )

Move the current node (and its subtree) one position to the left in the tree, i.e. before its left-hand sibling

Exceptions
RuntimeException
@return $this

Références $db.

◆ moveRight()

moveRight ( )

Move the current node (and its subtree) one position to the right in the tree, i.e. after its right-hand sibling

Exceptions
RuntimeException
@return $this

Références $db.

◆ moveToLeftOf()

moveToLeftOf ( FOFTableNested  $siblingNode)

Moves the current node (and its subtree) to the left of another node. The other node can be in a different position in the tree or even under a different root.

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, et $query.

◆ moveToRightOf()

moveToRightOf ( FOFTableNested  $siblingNode)

Moves the current node (and its subtree) to the right of another node. The other node can be in a different position in the tree or even under a different root.

Paramètres
FOFTableNested$siblingNode
Renvoie
$this for chaining
Exceptions
Exception
RuntimeException

Références $db, et $query.

◆ onAfterDelete()

onAfterDelete (   $oid)
protected

Références $db, $oid, $query, et $width.

◆ rebuild()

rebuild ( )

◆ reorder()

reorder (   $where = '')

Not supported in nested sets

Paramètres
string$whereIgnored
Renvoie
void
Exceptions
RuntimeException

◆ reset()

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.

Renvoie
void

◆ resetTreeCache()

resetTreeCache ( )
protected

Resets cached values used to speed up querying the tree

Renvoie
static for chaining

Références null.

◆ scopeAncestors()

scopeAncestors ( )
protected

get() will return all ancestor nodes but not ourselves

Renvoie
void

Références $db.

◆ scopeAncestorsAndSelf()

scopeAncestorsAndSelf ( )
protected

get() will return all ancestor nodes and ourselves

Renvoie
void

Références $db.

◆ scopeDescendants()

scopeDescendants ( )
protected

get() will return all descendants (even subtrees of subtrees!) but not ourselves

Renvoie
void

Références $db.

◆ scopeDescendantsAndSelf()

scopeDescendantsAndSelf ( )
protected

get() will return all descendants (even subtrees of subtrees!) and ourselves

Renvoie
void

Références $db.

◆ scopeImmediateDescendants()

scopeImmediateDescendants ( )
protected

get() will only return immediate descendants (first level children) of the current node

Renvoie
void

Références $db, $item, $key, et $query.

◆ scopeLeaves()

scopeLeaves ( )
protected

get() will return only leaf nodes

Renvoie
void

Références $db.

◆ scopeSiblings()

scopeSiblings ( )
protected

get() will return all sibling nodes but not ourselves

Renvoie
void

◆ scopeSiblingsAndSelf()

scopeSiblingsAndSelf ( )
protected

get() will return all sibling nodes and ourselves

Renvoie
void

Références $db.

◆ scopeWithoutRoot()

scopeWithoutRoot ( )
protected

get() will not return our root if it's part of the query results

Renvoie
void

◆ scopeWithoutSelf()

scopeWithoutSelf ( )
protected

get() will not return ourselves if it's part of the query results

Renvoie
void

◆ whereRaw()

whereRaw (   $rawWhereClause)

Add custom, pre-compiled WHERE clauses for use in buildQuery. The raw WHERE clause you specify is added as is to the query generated by buildQuery. You are responsible for quoting and escaping the field names and data found inside the WHERE clause.

Paramètres
string$rawWhereClauseThe raw WHERE clause to add
Renvoie
$this For chaining

◆ withoutNode()

withoutNode ( FOFTableNested  $node)

get() will not return the selected node if it's part of the query results

Paramètres
FOFTableNested$nodeThe node to exclude from the results
Renvoie
void

Références $db.

Documentation des champs

◆ $treeDepth

$treeDepth = null
protected

◆ $treeNestedGet

$treeNestedGet = false
protected

◆ $treeParent

$treeParent = null
protected

◆ $treeRoot

$treeRoot = null
protected

◆ $whereClauses

$whereClauses = array()
protected

La documentation de cette classe a été générée à partir du fichier suivant :