Devise\Support\Sortable\Manager::setCookie PHP Метод

setCookie() приватный Метод

private setCookie ( $all, $cookie, $newSort ) : mixed
$all
$cookie
$newSort
Результат mixed
    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;
    }