protected function setSortDirection($sortDirection)
    {
        if (!in_array($sortDirection, [
            MediaLibrary::SORT_DIRECTION_ASC,
            MediaLibrary::SORT_DIRECTION_DESC
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('media_sort_direction', $sortDirection);
    }
protected function setSortDirection($sortDirection)
    {
        if (!in_array($sortDirection, [
            MediaLibrary::SORT_DIRECTION_ASC,
            MediaLibrary::SORT_DIRECTION_DESC
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('media_sort_direction', $sortDirection);
    }
protected function setSortDirection ( $ sortDirection ) { if ( ! in_array ( $ sortDirection , [ MediaLibrary :: SORT_DIRECTION_ASC , MediaLibrary :: SORT_DIRECTION_DESC ] ) ) { throw new ApplicationException ( 'Invalid input data' ) ; } $ this -> putSession ( 'media_sort_direction' , $ sortDirection ) ; }
Sets the user sort direction from the session state
@param string $sortDirection
@return void
Sets the user sort direction from the session state