/**
  * Gets node sortable builder
  *
  * @param string $key
  * @param string $direction
  * @param string $type
  * @param int $limit
  * @param string $locale
  * @return Builder
  */
 public function getSortedNodesBuilder($key = null, $direction = null, $type = null, $limit = null, $locale = null)
 {
     $builder = PublishedNode::translatedIn($locale)->groupBy('nodes.id');
     if ($type) {
         $builder->withType($type);
     }
     if ($limit) {
         $builder->limit($limit);
     }
     return $builder->sortable($key, $direction);
 }