src/wcmf/application/controller/SortController.php
protected function loadPreviousObject($type, $sortkeyName, $sortkeyValue, $sortDirection) {
    $query = new ObjectQuery($type);
    $tpl = $query->getObjectTemplate($type);
    $tpl->setValue($sortkeyName, Criteria::asValue($sortDirection == 'ASC' ? '<' : '>', $sortkeyValue), true);
    $pagingInfo = new PagingInfo(1, true);
    $objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".($sortDirection == 'ASC' ? 'DESC' : 'ASC')], $pagingInfo);
    return sizeof($objects) > 0 ? $objects[0] : null;
  }
protected function loadPreviousObject($type, $sortkeyName, $sortkeyValue, $sortDirection) {
    $query = new ObjectQuery($type);
    $tpl = $query->getObjectTemplate($type);
    $tpl->setValue($sortkeyName, Criteria::asValue($sortDirection == 'ASC' ? '<' : '>', $sortkeyValue), true);
    $pagingInfo = new PagingInfo(1, true);
    $objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".($sortDirection == 'ASC' ? 'DESC' : 'ASC')], $pagingInfo);
    return sizeof($objects) > 0 ? $objects[0] : null;
  }
protected function loadPreviousObject ( $ type , $ sortkeyName , $ sortkeyValue , $ sortDirection ) { $ query = new ObjectQuery ( $ type ) ; $ tpl = $ query -> getObjectTemplate ( $ type ) ; $ tpl -> setValue ( $ sortkeyName , Criteria :: asValue ( $ sortDirection == 'ASC' ? '<' : '>' , $ sortkeyValue ) , true ) ; $ pagingInfo = new PagingInfo ( 1 , true ) ; $ objects = $ query -> execute ( BuildDepth :: SINGLE , [ $ sortkeyName . " " . ( $ sortDirection == 'ASC' ? 'DESC' : 'ASC' ) ] , $ pagingInfo ) ; return sizeof ( $ objects ) > 0 ? $ objects [ 0 ] : null ; }
Load the object which order position is before the given sort value
@param $type The type of objects
@param $sortkeyName The name of the sortkey attribute
@param $sortkeyValue The reference sortkey value
@param $sortDirection The sort direction used with the sort key
Load the object which order position is before the given sort value