src/wcmf/application/controller/SortController.php
protected function loadLastObject($type, $sortkeyName, $sortDirection) {
    $query = new ObjectQuery($type);
    $pagingInfo = new PagingInfo(1, true);
    $invSortDir = $sortDirection == 'ASC' ? 'DESC' : 'ASC';
    $objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".$invSortDir], $pagingInfo);
    return sizeof($objects) > 0 ? $objects[0] : null;
  }
protected function loadLastObject($type, $sortkeyName, $sortDirection) {
    $query = new ObjectQuery($type);
    $pagingInfo = new PagingInfo(1, true);
    $invSortDir = $sortDirection == 'ASC' ? 'DESC' : 'ASC';
    $objects = $query->execute(BuildDepth::SINGLE, [$sortkeyName." ".$invSortDir], $pagingInfo);
    return sizeof($objects) > 0 ? $objects[0] : null;
  }
protected function loadLastObject ( $ type , $ sortkeyName , $ sortDirection ) { $ query = new ObjectQuery ( $ type ) ; $ pagingInfo = new PagingInfo ( 1 , true ) ; $ invSortDir = $ sortDirection == 'ASC' ? 'DESC' : 'ASC' ; $ objects = $ query -> execute ( BuildDepth :: SINGLE , [ $ sortkeyName . " " . $ invSortDir ] , $ pagingInfo ) ; return sizeof ( $ objects ) > 0 ? $ objects [ 0 ] : null ; }
Load the last object regarding the given sort key
@param $type The type of objects
@param $sortkeyName The name of the sortkey attribute
@param $sortDirection The sort direction used with the sort key
Load the last object regarding the given sort key