Tree

The tree service allows retrieval of folders, email, lists, profiles, etc. from Maxemail's core tree structure.

nodeClass

These are the available nodeClass for use in #fetchTree and #fetchNode:

  • root
  • folder
  • campaign
  • email_campaign
  • list
  • profile
  • profile_field
  • data_export

Trees

These are the available tree roots for use in #fetchRoot and #fetchTree:

  • behaviour
  • comparison_report
  • data_export
  • dcontent_ruleset
  • email
  • email_template
  • list
  • profile
  • segment
  • snippet


fetchRoot

array tree.fetchTree( string tree, array children )

Details the tree specified.

Parameters

tree

Name of the tree of which to retrieve the children. For available trees, see #Trees.

children

Associative array of nodes to which the returned tree should be 'expanded' to include, where the array key is the #nodeClass, and the value is the nodeId.
Example:

tree->fetchRoot( 'email' );

tree->fetchRoot( 'email', array('email_campaign' => 3) );

Return Values

Returns an associative array. The possible returned elements are as follows:

Name

Type

Description

text

string

node name

nodeId

int

node's unique system identifier

nodeClass

string

class of node

hasChildren

bool

The node has children

rootNode

bool

The node is a root

editable

bool

The node can be edited

deletable

bool

The node can be deleted

expanded

bool

The node is expanded

children

array

Associative array of child nodes

children

Associative array containing information about the node, for possible elements, see #fetchNode.
Will also contain any further children required to reach the node specified in the children parameter.



fetchTree

array tree.fetchTree( string tree, string nodeClass, int nodeId )

Details the node specified.

Parameters

tree

Name of the tree of which to retrieve the children. For available trees, see #Trees.

nodeClass

The nodeClass of the node from which to retrieve the children. For available trees, see #nodeClass.

nodeId

The ID of the node from which to retrieve the children.

Return Values

Returns an array of associative arrays. For the possible returned elements, see #fetchNode.



fetchNode

array tree.fetchNode( string nodeClass, int nodeId )

Details the node specified.

Parameters

nodeClass

The nodeClass of the node from which to retrieve the children. For available trees, see #nodeClass.

nodeId

The ID of the node from which to retrieve the children.

Return Values

Returns an associative array. The possible returned elements are as follows:

Name

Type

Description

text

string

node name

nodeId

int

node's unique system identifier

nodeClass

string

class of node

hasChildren

bool

The node has children

properties

array

Associative array of additional properties applicable to the nodeClass



fetchNodes

array tree.fetchNodes( array nodes )

Details the nodes specified.

Parameters

nodes

Associative array of parameters as for #fetchNode for each node that you wish to query.

Return Values

Returns an associative arrays for each successful node queried, as an indexed array. For the possible returned elements, see #fetchNode.

Service

tree

Methods