original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Sets the user sort direction from the session state
  @param string $sortDirection
  @return void
docstring_tokens: Sets the user sort direction from the session state