‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Tree\ComparableNodeInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Backend\Tree\ComparableNodeInterface:
TYPO3\CMS\Backend\Tree\TreeNode TYPO3\CMS\Backend\Tree\TreeRepresentationNode TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeNode

Public Member Functions

int compareTo ($other)
 

Detailed Description

Interface that defines the comparison of nodes

Definition at line 21 of file ComparableNodeInterface.php.

Member Function Documentation

◆ compareTo()

int 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.