Propel API
Interface

NodePeer

interface NodePeer

This is a utility interface for all generated NodePeer classes in the system.

Methods

static object createRoot(NodeObject $node)

Creates the supplied node as the root node.

static object retrieveRoot(int $scopeId = 1, PropelPDO $con = null)

Returns the root node for a given scope id

static void insertAsFirstChildOf(NodeObject $child, NodeObject $parent, PropelPDO $con = null)

Inserts $child as first child of destination node $parent

static void insertAsLastChildOf(NodeObject $child, NodeObject $parent, PropelPDO $con = null)

Inserts $child as last child of destination node $parent

static void insertAsPrevSiblingOf(NodeObject $node, NodeObject $sibling, PropelPDO $con = null)

Inserts $sibling as previous sibling to destination node $node

static void insertAsNextSiblingOf(NodeObject $node, NodeObject $sibling, PropelPDO $con = null)

Inserts $sibling as next sibling to destination node $node

static void insertAsParentOf(NodeObject $parent, NodeObject $node, PropelPDO $con = null)

Inserts $parent as parent of given $node.

static void insertRoot(NodeObject $node, PropelPDO $con = null)

Inserts $node as root node

static boolean deleteRoot(int $scopeId = 1, PropelPDO $con = null)

Delete root node

static boolean deleteNode(NodeObject $dest, PropelPDO $con = null)

Delete $dest node

static void moveToFirstChildOf(NodeObject $parent, NodeObject $child, PropelPDO $con = null)

Moves $child to be first child of $parent

static void moveToLastChildOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be last child of $dest

static void moveToPrevSiblingOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be prev sibling to $dest

static void moveToNextSiblingOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be next sibling to $dest

static mixed retrieveFirstChild(NodeObject $node, PropelPDO $con = null)

Gets first child for the given node if it exists

static mixed retrieveLastChild(NodeObject $node, PropelPDO $con = null)

Gets last child for the given node if it exists

static mixed retrievePrevSibling(NodeObject $node, PropelPDO $con = null)

Gets prev sibling for the given node if it exists

static mixed retrieveNextSibling(NodeObject $node, PropelPDO $con = null)

Gets next sibling for the given node if it exists

static  retrieveTree(int $scopeId = 1, PropelPDO $con = null)

Retrieves the entire tree from root

static  retrieveBranch(NodeObject $node, PropelPDO $con = null)

Retrieves the entire tree from parent $node

static  retrieveChildren(NodeObject $node, PropelPDO $con = null)

Gets direct children for the node

static  retrieveDescendants(NodeObject $node, PropelPDO $con = null)

Gets all descendants for the node

static  retrieveSiblings(NodeObject $node, PropelPDO $con = null)

Gets all siblings for the node

static mixed retrieveParent(NodeObject $node, PropelPDO $con = null)

Gets ancestor for the given node if it exists

static int getLevel(NodeObject $node, PropelPDO $con = null)

Gets level for the given node

static int getNumberOfChildren(NodeObject $node, PropelPDO $con = null)

Gets number of direct children for given node

static int getNumberOfDescendants(NodeObject $node, PropelPDO $con = null)

Gets number of descendants for given node

static array getPath(NodeObject $node, PropelPDO $con = null)

Returns path to a specific node as an array, useful to create breadcrumbs

static bool isValid(NodeObject $node = null)

Tests if node is valid

static bool isRoot(NodeObject $node)

Tests if node is a root

static bool isLeaf(NodeObject $node)

Tests if node is a leaf

static bool isChildOf(NodeObject $child, NodeObject $parent)

Tests if $child is a child of $parent

static bool isEqualTo(NodeObject $node1, NodeObject $node2)

Tests if $node1 is equal to $node2

static bool hasParent(NodeObject $node, PropelPDO $con = null)

Tests if $node has an ancestor

static bool hasPrevSibling(NodeObject $node, PropelPDO $con = null)

Tests if $node has prev sibling

static bool hasNextSibling(NodeObject $node, PropelPDO $con = null)

Tests if $node has next sibling

static bool hasChildren(NodeObject $node)

Tests if $node has children

static  deleteDescendants(NodeObject $node, PropelPDO $con = null)

Deletes $node and all of its descendants

static object getNode(int/object $node, PropelPDO $con = null)

Returns a node given its primary key or the node itself

Details

at line 26
static public object createRoot(NodeObject $node)

Creates the supplied node as the root node.

Parameters

NodeObject $node Propel object for model

Return Value

object Inserted propel object for model

at line 35
static public object retrieveRoot(int $scopeId = 1, PropelPDO $con = null)

Returns the root node for a given scope id

Parameters

int $scopeId Scope id to determine which root node to return
PropelPDO $con Connection to use.

Return Value

object Propel object for root node

at line 45
static public void insertAsFirstChildOf(NodeObject $child, NodeObject $parent, PropelPDO $con = null)

Inserts $child as first child of destination node $parent

Parameters

NodeObject $child Propel object for child node
NodeObject $parent Propel object for parent node
PropelPDO $con Connection to use.

Return Value

void

at line 55
static public void insertAsLastChildOf(NodeObject $child, NodeObject $parent, PropelPDO $con = null)

Inserts $child as last child of destination node $parent

Parameters

NodeObject $child Propel object for child node
NodeObject $parent Propel object for parent node
PropelPDO $con Connection to use.

Return Value

void

at line 65
static public void insertAsPrevSiblingOf(NodeObject $node, NodeObject $sibling, PropelPDO $con = null)

Inserts $sibling as previous sibling to destination node $node

Parameters

NodeObject $node Propel object for destination node
NodeObject $sibling Propel object for source node
PropelPDO $con Connection to use.

Return Value

void

at line 75
static public void insertAsNextSiblingOf(NodeObject $node, NodeObject $sibling, PropelPDO $con = null)

Inserts $sibling as next sibling to destination node $node

Parameters

NodeObject $node Propel object for destination node
NodeObject $sibling Propel object for source node
PropelPDO $con Connection to use.

Return Value

void

at line 86
static public void insertAsParentOf(NodeObject $parent, NodeObject $node, PropelPDO $con = null)

Inserts $parent as parent of given $node.

Parameters

NodeObject $parent Propel object for given parent node
NodeObject $node Propel object for given destination node
PropelPDO $con Connection to use.

Return Value

void

Exceptions

Exception When trying to insert node as parent of a root node

at line 95
static public void insertRoot(NodeObject $node, PropelPDO $con = null)

Inserts $node as root node

Parameters

NodeObject $node Propel object as root node
PropelPDO $con Connection to use.

Return Value

void

at line 104
static public boolean deleteRoot(int $scopeId = 1, PropelPDO $con = null)

Delete root node

Parameters

int $scopeId Scope id to determine which root node to delete
PropelPDO $con Connection to use.

Return Value

boolean Deletion status

at line 113
static public boolean deleteNode(NodeObject $dest, PropelPDO $con = null)

Delete $dest node

Parameters

NodeObject $dest Propel object node to delete
PropelPDO $con Connection to use.

Return Value

boolean Deletion status

at line 123
static public void moveToFirstChildOf(NodeObject $parent, NodeObject $child, PropelPDO $con = null)

Moves $child to be first child of $parent

Parameters

NodeObject $parent Propel object for parent node
NodeObject $child Propel object for child node
PropelPDO $con Connection to use.

Return Value

void

at line 133
static public void moveToLastChildOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be last child of $dest

Parameters

NodeObject $dest Propel object for destination node
NodeObject $node Propel object for source node
PropelPDO $con Connection to use.

Return Value

void

at line 143
static public void moveToPrevSiblingOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be prev sibling to $dest

Parameters

NodeObject $dest Propel object for destination node
NodeObject $node Propel object for source node
PropelPDO $con Connection to use.

Return Value

void

at line 153
static public void moveToNextSiblingOf(NodeObject $dest, NodeObject $node, PropelPDO $con = null)

Moves $node to be next sibling to $dest

Parameters

NodeObject $dest Propel object for destination node
NodeObject $node Propel object for source node
PropelPDO $con Connection to use.

Return Value

void

at line 162
static public mixed retrieveFirstChild(NodeObject $node, PropelPDO $con = null)

Gets first child for the given node if it exists

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

mixed Propel object if exists else false

at line 171
static public mixed retrieveLastChild(NodeObject $node, PropelPDO $con = null)

Gets last child for the given node if it exists

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

mixed Propel object if exists else false

at line 180
static public mixed retrievePrevSibling(NodeObject $node, PropelPDO $con = null)

Gets prev sibling for the given node if it exists

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

mixed Propel object if exists else false

at line 189
static public mixed retrieveNextSibling(NodeObject $node, PropelPDO $con = null)

Gets next sibling for the given node if it exists

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

mixed Propel object if exists else false

at line 197
static public retrieveTree(int $scopeId = 1, PropelPDO $con = null)

Retrieves the entire tree from root

Parameters

int $scopeId Scope id to determine which scope tree to return
PropelPDO $con Connection to use.

at line 204
static public retrieveBranch(NodeObject $node, PropelPDO $con = null)

Retrieves the entire tree from parent $node

Parameters

NodeObject $node
PropelPDO $con

at line 212
static public retrieveChildren(NodeObject $node, PropelPDO $con = null)

Gets direct children for the node

Parameters

NodeObject $node Propel object for parent node
PropelPDO $con Connection to use.

at line 220
static public retrieveDescendants(NodeObject $node, PropelPDO $con = null)

Gets all descendants for the node

Parameters

NodeObject $node Propel object for parent node
PropelPDO $con Connection to use.

at line 228
static public retrieveSiblings(NodeObject $node, PropelPDO $con = null)

Gets all siblings for the node

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

at line 237
static public mixed retrieveParent(NodeObject $node, PropelPDO $con = null)

Gets ancestor for the given node if it exists

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

mixed Propel object if exists else false

at line 246
static public int getLevel(NodeObject $node, PropelPDO $con = null)

Gets level for the given node

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

int Level for the given node

at line 255
static public int getNumberOfChildren(NodeObject $node, PropelPDO $con = null)

Gets number of direct children for given node

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

int Level for the given node

at line 264
static public int getNumberOfDescendants(NodeObject $node, PropelPDO $con = null)

Gets number of descendants for given node

Parameters

NodeObject $node Propel object for src node
PropelPDO $con Connection to use.

Return Value

int Level for the given node

at line 273
static public array getPath(NodeObject $node, PropelPDO $con = null)

Returns path to a specific node as an array, useful to create breadcrumbs

Parameters

NodeObject $node Propel object of node to create path to
PropelPDO $con Connection to use.

Return Value

array Array in order of heirarchy

at line 281
static public bool isValid(NodeObject $node = null)

Tests if node is valid

Parameters

NodeObject $node Propel object for src node

Return Value

bool

at line 289
static public bool isRoot(NodeObject $node)

Tests if node is a root

Parameters

NodeObject $node Propel object for src node

Return Value

bool

at line 297
static public bool isLeaf(NodeObject $node)

Tests if node is a leaf

Parameters

NodeObject $node Propel object for src node

Return Value

bool

at line 306
static public bool isChildOf(NodeObject $child, NodeObject $parent)

Tests if $child is a child of $parent

Parameters

NodeObject $child Propel object for node
NodeObject $parent Propel object for node

Return Value

bool

at line 315
static public bool isEqualTo(NodeObject $node1, NodeObject $node2)

Tests if $node1 is equal to $node2

Parameters

NodeObject $node1 Propel object for node
NodeObject $node2 Propel object for node

Return Value

bool

at line 324
static public bool hasParent(NodeObject $node, PropelPDO $con = null)

Tests if $node has an ancestor

Parameters

NodeObject $node Propel object for node
PropelPDO $con Connection to use.

Return Value

bool

at line 333
static public bool hasPrevSibling(NodeObject $node, PropelPDO $con = null)

Tests if $node has prev sibling

Parameters

NodeObject $node Propel object for node
PropelPDO $con Connection to use.

Return Value

bool

at line 342
static public bool hasNextSibling(NodeObject $node, PropelPDO $con = null)

Tests if $node has next sibling

Parameters

NodeObject $node Propel object for node
PropelPDO $con Connection to use.

Return Value

bool

at line 350
static public bool hasChildren(NodeObject $node)

Tests if $node has children

Parameters

NodeObject $node Propel object for node

Return Value

bool

at line 358
static public deleteDescendants(NodeObject $node, PropelPDO $con = null)

Deletes $node and all of its descendants

Parameters

NodeObject $node Propel object for source node
PropelPDO $con Connection to use.

at line 367
static public object getNode(int/object $node, PropelPDO $con = null)

Returns a node given its primary key or the node itself

Parameters

int/object $node Primary key/instance of required node
PropelPDO $con Connection to use.

Return Value

object Propel object for model