31 function __construct()
33 $this->logger =
new Logger(self::class);
43 if (array_key_exists(
'iSortingCols', $inputArray)) {
44 if ($inputArray[
'iSortingCols'] > count($columNamesInDatabase)) {
45 $this->logger->addWarning(
46 "did have enough columNames for " . $inputArray[
'iSortingCols'] .
51 $columNamesInDatabase, $defaultSearch);
53 $this->logger->addWarning(
"did not find iSortingCols in inputArray");
67 $orderArray = array();
68 $sortedCols = array();
69 for ($i = 0; $i < $inputArray[
'iSortingCols']; $i ++) {
70 $whichCol =
'iSortCol_' . $i;
71 $colNumber = $inputArray[$whichCol];
72 $sortedCols[] = intval($colNumber);
74 $isSortable = $inputArray[
'bSortable_' . $i];
75 if ($isSortable !==
"true") {
78 $name = $columNamesInDatabase[$colNumber];
80 $whichDir =
'sSortDir_' . $i;
81 $order = $inputArray[$whichDir];
82 $orderArray[] = $name .
" " . $order;
85 foreach ($defaultSearch as $search) {
86 $colNumber = $search[0];
88 if (in_array($colNumber, $sortedCols)) {
91 $isSortable = $inputArray[
'bSortable_' . $colNumber];
92 if ($isSortable !==
"true") {
96 $name = $columNamesInDatabase[$colNumber];
97 $orderArray[] = $name .
" " . $order;
109 public function getSortingString($inputArray, $columNamesInDatabase, $defaultSearch = array())
112 $orderString = empty($orderArray) ?
"" :
"ORDER BY " . implode(
", ", $orderArray);
getSortingString($inputArray, $columNamesInDatabase, $defaultSearch=array())
getSortingParametersFromArray($inputArray, $columNamesInDatabase, $defaultSearch=array())
getSortingParametersFromArrayImpl($inputArray, $columNamesInDatabase, $defaultSearch=array())