original_string: protected function _calculateRedirection(EntityInterface $content)
      {
          foreach (['translation', 'parent'] as $method) {
              if ($has = $content->{$method}()) {
                  return option('url_locale_prefix') ? '/' . $has->get('language') . stripLanguagePrefix($has->get('url')) : $has->get('url');
              }
          }
  
          return '';
      }
code: protected function _calculateRedirection(EntityInterface $content)
      {
          foreach (['translation', 'parent'] as $method) {
              if ($has = $content->{$method}()) {
                  return option('url_locale_prefix') ? '/' . $has->get('language') . stripLanguagePrefix($has->get('url')) : $has->get('url');
              }
          }
  
          return '';
      }
code_tokens: protected function _calculateRedirection ( EntityInterface $ content ) { foreach ( [ 'translation' , 'parent' ] as $ method ) { if ( $ has = $ content -> { $ method } ( ) ) { return option ( 'url_locale_prefix' ) ? '/' . $ has -> get ( 'language' ) . stripLanguagePrefix ( $ has -> get ( 'url' ) ) : $ has -> get ( 'url' ) ; } } return '' ; }
docstring: Calculates the URL to which visitor should be redirected according to
  content's & visitor's language.
  
  @param \Cake\Datasource\EntityInterface $content Content to inspect
  @return string Redirection URL, empty on error
docstring_tokens: Calculates the URL to which visitor should be redirected according to content s & visitor s language .