private function setCookie($all, $cookie, $newSort)
{
$set = false;
foreach ($cookie as $key => $c) {
if (isset($c['orderBy']) && isset($newSort['orderBy'])) {
if ($c['orderBy'] == $newSort['orderBy'] && (!isset($c['relationship']) || $c['relationship'] == $newSort['relationship'])) {
$cookie[$key] = $all;
$set = true;
}
}
}
if (!$set) {
array_push($cookie, $newSort);
return $cookie;
}
return $cookie;
}