TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Tree\ComparableNodeInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Backend\Tree\ComparableNodeInterface:
TYPO3\CMS\Backend\Tree\TreeNode TYPO3\CMS\Backend\Tree\ExtDirectNode TYPO3\CMS\Backend\Tree\TreeRepresentationNode TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeNode

Public Member Functions

 compareTo ($other)
 

Detailed Description

Interface that defines the comparison of nodes

Definition at line 20 of file ComparableNodeInterface.php.

Member Function Documentation

◆ compareTo()

TYPO3\CMS\Backend\Tree\ComparableNodeInterface::compareTo (   $other)

Compare Node against another one

Returns: 1 if the current node is greater than the $other, -1 if $other is greater than the current node and 0 if the nodes are equal

Example

if ($this->sortValue > $other->sortValue) {
return 1;
} elseif ($this->sortValue < $other->sortValue) {
return -1;
} else {
return 0;
}
Parameters
\TYPO3\CMS\Backend\Tree\TreeNode$other
Returns
int see description

Implemented in TYPO3\CMS\Backend\Tree\TreeNode, and TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeNode.