src/wcmf/lib/model/NodeSortkeyComparator.php
protected function getSortkeyValue(Node $node) {
    // if no role is defined for a or b, the sortkey is
    // determined from the type of the reference node
    $defaultRole = $this->referenceNode->getType();
    $referenceMapper = $this->referenceNode->getMapper();
    $mapper = $node->getMapper();

    if ($referenceMapper && $mapper) {

      $referenceRole = $defaultRole;
      // get the sortkey of the node for the relation to the reference node,
      // if a role is defined
      $oidStr = $node->getOID()->__toString();
      if (isset($this->oidRoleMap[$oidStr])) {
        $nodeRole = $this->oidRoleMap[$oidStr];
        $relationDesc = $referenceMapper->getRelation($nodeRole);
        $referenceRole = $relationDesc->getThisRole();
      }
      $sortkeyDef = $mapper->getSortkey($referenceRole);
      return $node->getValue($sortkeyDef['sortFieldName']);
    }
    return 0;
  }
protected function getSortkeyValue(Node $node) {
    // if no role is defined for a or b, the sortkey is
    // determined from the type of the reference node
    $defaultRole = $this->referenceNode->getType();
    $referenceMapper = $this->referenceNode->getMapper();
    $mapper = $node->getMapper();

    if ($referenceMapper && $mapper) {

      $referenceRole = $defaultRole;
      // get the sortkey of the node for the relation to the reference node,
      // if a role is defined
      $oidStr = $node->getOID()->__toString();
      if (isset($this->oidRoleMap[$oidStr])) {
        $nodeRole = $this->oidRoleMap[$oidStr];
        $relationDesc = $referenceMapper->getRelation($nodeRole);
        $referenceRole = $relationDesc->getThisRole();
      }
      $sortkeyDef = $mapper->getSortkey($referenceRole);
      return $node->getValue($sortkeyDef['sortFieldName']);
    }
    return 0;
  }
protected function getSortkeyValue ( Node $ node ) { // if no role is defined for a or b, the sortkey is // determined from the type of the reference node $ defaultRole = $ this -> referenceNode -> getType ( ) ; $ referenceMapper = $ this -> referenceNode -> getMapper ( ) ; $ mapper = $ node -> getMapper ( ) ; if ( $ referenceMapper && $ mapper ) { $ referenceRole = $ defaultRole ; // get the sortkey of the node for the relation to the reference node, // if a role is defined $ oidStr = $ node -> getOID ( ) -> __toString ( ) ; if ( isset ( $ this -> oidRoleMap [ $ oidStr ] ) ) { $ nodeRole = $ this -> oidRoleMap [ $ oidStr ] ; $ relationDesc = $ referenceMapper -> getRelation ( $ nodeRole ) ; $ referenceRole = $ relationDesc -> getThisRole ( ) ; } $ sortkeyDef = $ mapper -> getSortkey ( $ referenceRole ) ; return $ node -> getValue ( $ sortkeyDef [ 'sortFieldName' ] ) ; } return 0 ; }
Get the sortkey value of a node in the given relation
@param $node Node
@return Number
Get the sortkey value of a node in the given relation