Ublaboo\DataGrid\Utils\Sorting::getSortCallback PHP Method

getSortCallback() public method

public getSortCallback ( ) : callable | null
return callable | null
    public function getSortCallback()
    {
        return $this->sort_callback;
    }

Usage Example

 /**
  * Sort data
  * @param Sorting $sorting
  * @return static
  */
 public function sort(Sorting $sorting)
 {
     if (is_callable($sorting->getSortCallback())) {
         call_user_func($sorting->getSortCallback(), $this->criteria, $sorting->getSort());
         return $this;
     }
     if ($sort = $sorting->getSort()) {
         $this->criteria->orderBy($sort);
         return $this;
     }
     $this->criteria->orderBy([$this->primary_key => 'ASC']);
     return $this;
 }
All Usage Examples Of Ublaboo\DataGrid\Utils\Sorting::getSortCallback