PHP 클래스 PMA\libraries\navigation\nodes\Node

파일 보기 프로젝트 열기: phpmyadmin/phpmyadmin 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$children An array of Node objects that are direct children of this node
$classes Extra CSS classes for the node
$icon An IMG tag, used when rendering the node
$isNew Whether this node is a link for creating new objects
$is_group Whether this object has been created while grouping nodes Only relevant if the node is of type CONTAINER
$links An array of A tags, used when rendering the node The indexes in the array may be 'icon' and 'text'
$name A non-unique identifier for the node This may be trimmed when grouping nodes
$parent A reference to the parent object of this node, NULL for the root node.
$pos2 The position for the pagination of the branch at the second level of the tree
$pos3 The position for the pagination of the branch at the third level of the tree
$real_name A non-unique identifier for the node This will never change after being assigned
$separator A string used to group nodes, or an array of strings Only relevant if the node is of type CONTAINER
$separator_depth How many time to recursively apply the grouping function Only relevant if the node is of type CONTAINER
$title HTML title
$type May be one of CONTAINER or OBJECT
$visible Whether to add a "display: none;" CSS rule to the node when rendering it

공개 메소드들

메소드 설명
__construct ( string $name, integer $type = Node::OBJECT, boolean $is_group = false ) Initialises the class by setting the mandatory variables
addChild ( Node $child ) : void Adds a child node to this node
getChild ( string $name, boolean $real_name = false ) : false | Node Returns a child node given it's name
getCssClasses ( boolean $match ) : String Returns CSS classes for a node
getData ( string $type, integer $pos, string $searchClause = '' ) : array Returns the names of children of type $type present inside this container This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes
getHtmlForControlButtons ( ) : String Returns HTML for control buttons displayed infront of a node
getIcon ( boolean $match ) : String Returns icon for the node
getNavigationHidingData ( ) : array Gets the count of hidden elements for each database
getPaths ( ) : array Returns the actual path and the virtual paths for a node both as clean arrays and base64 encoded strings
getPresence ( string $type = '', string $searchClause = '' ) : integer Returns the number of children of type $type present inside this container This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes
hasChildren ( boolean $count_empty_containers = true ) : boolean This function checks if the node has children nodes associated with it
hasSiblings ( ) : boolean Returns true if the node has some siblings (other nodes on the same tree level, in the same branch), false otherwise.
numChildren ( ) : integer Returns the number of child nodes that a node has associated with it
parents ( boolean $self = false, boolean $containers = false, boolean $groups = false ) : array Retrieves the parents for a node
realParent ( ) : Node | false Returns the actual parent of a node. If used twice on an index or columns node, it will return the table and database nodes. The names of the returned nodes can be used in SQL queries, etc.
removeChild ( string $name ) : void Removes a child node from this node

비공개 메소드들

메소드 설명
_getDatabasesToSearch ( string $searchClause ) : array Get the list of databases for 'SHOW DATABASES LIKE' queries.
_getWhereClause ( string $columnName, string $searchClause = '' ) : string Returns the WHERE clause depending on the $searchClause parameter and the hide_db directive
_isHideDb ( string $db ) : boolean Detemines whether a given database should be hidden according to 'hide_db'

메소드 상세

__construct() 공개 메소드

Initialises the class by setting the mandatory variables
public __construct ( string $name, integer $type = Node::OBJECT, boolean $is_group = false )
$name string An identifier for the new node
$type integer Type of node, may be one of CONTAINER or OBJECT
$is_group boolean Whether this object has been created while grouping nodes

addChild() 공개 메소드

Adds a child node to this node
public addChild ( Node $child ) : void
$child Node A child node
리턴 void

getChild() 공개 메소드

Returns a child node given it's name
public getChild ( string $name, boolean $real_name = false ) : false | Node
$name string The name of requested child
$real_name boolean Whether to use the "real_name" instead of "name" in comparisons
리턴 false | Node The requested child node or false, if the requested node cannot be found

getCssClasses() 공개 메소드

Returns CSS classes for a node
public getCssClasses ( boolean $match ) : String
$match boolean Whether the node matched loaded tree
리턴 String with html classes.

getData() 공개 메소드

Returns the names of children of type $type present inside this container This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes
public getData ( string $type, integer $pos, string $searchClause = '' ) : array
$type string The type of item we are looking for ('tables', 'views', etc)
$pos integer The offset of the list within the results
$searchClause string A string used to filter the results of the query
리턴 array

getHtmlForControlButtons() 공개 메소드

Returns HTML for control buttons displayed infront of a node
public getHtmlForControlButtons ( ) : String
리턴 String HTML for control buttons

getIcon() 공개 메소드

Returns icon for the node
public getIcon ( boolean $match ) : String
$match boolean Whether the node matched loaded tree
리턴 String with image name

getNavigationHidingData() 공개 메소드

Gets the count of hidden elements for each database
public getNavigationHidingData ( ) : array
리턴 array array containing the count of hidden elements for each database

getPaths() 공개 메소드

Returns the actual path and the virtual paths for a node both as clean arrays and base64 encoded strings
public getPaths ( ) : array
리턴 array

getPresence() 공개 메소드

Returns the number of children of type $type present inside this container This method is overridden by the PMA\libraries\navigation\nodes\NodeDatabase and PMA\libraries\navigation\nodes\NodeTable classes
public getPresence ( string $type = '', string $searchClause = '' ) : integer
$type string The type of item we are looking for ('tables', 'views', etc)
$searchClause string A string used to filter the results of the query
리턴 integer

hasChildren() 공개 메소드

This function checks if the node has children nodes associated with it
public hasChildren ( boolean $count_empty_containers = true ) : boolean
$count_empty_containers boolean Whether to count empty child containers as valid children
리턴 boolean Whether the node has child nodes

hasSiblings() 공개 메소드

The only exception is for nodes on the third level of the tree (columns and indexes), for which the function always returns true. This is because we want to render the containers for these nodes
public hasSiblings ( ) : boolean
리턴 boolean

numChildren() 공개 메소드

Returns the number of child nodes that a node has associated with it
public numChildren ( ) : integer
리턴 integer The number of children nodes

parents() 공개 메소드

Retrieves the parents for a node
public parents ( boolean $self = false, boolean $containers = false, boolean $groups = false ) : array
$self boolean Whether to include the Node itself in the results
$containers boolean Whether to include nodes of type CONTAINER
$groups boolean Whether to include nodes which have $group == true
리턴 array An array of parent Nodes

realParent() 공개 메소드

..
public realParent ( ) : Node | false
리턴 Node | false

removeChild() 공개 메소드

Removes a child node from this node
public removeChild ( string $name ) : void
$name string The name of child to be removed
리턴 void

프로퍼티 상세

$children 공개적으로 프로퍼티

An array of Node objects that are direct children of this node
public $children

$classes 공개적으로 프로퍼티

Extra CSS classes for the node
public $classes

$icon 공개적으로 프로퍼티

An IMG tag, used when rendering the node
public $icon

$isNew 공개적으로 프로퍼티

Whether this node is a link for creating new objects
public $isNew

$is_group 공개적으로 프로퍼티

Whether this object has been created while grouping nodes Only relevant if the node is of type CONTAINER
public $is_group

$name 공개적으로 프로퍼티

A non-unique identifier for the node This may be trimmed when grouping nodes
public $name

$parent 공개적으로 프로퍼티

A reference to the parent object of this node, NULL for the root node.
public $parent

$pos2 공개적으로 프로퍼티

The position for the pagination of the branch at the second level of the tree
public $pos2

$pos3 공개적으로 프로퍼티

The position for the pagination of the branch at the third level of the tree
public $pos3

$real_name 공개적으로 프로퍼티

A non-unique identifier for the node This will never change after being assigned
public $real_name

$separator 공개적으로 프로퍼티

A string used to group nodes, or an array of strings Only relevant if the node is of type CONTAINER
public $separator

$separator_depth 공개적으로 프로퍼티

How many time to recursively apply the grouping function Only relevant if the node is of type CONTAINER
public $separator_depth

$title 공개적으로 프로퍼티

HTML title
public $title

$type 공개적으로 프로퍼티

May be one of CONTAINER or OBJECT
public $type

$visible 공개적으로 프로퍼티

Whether to add a "display: none;" CSS rule to the node when rendering it
public $visible