original_string: protected function getThumbnail()
      {
          if (!$this->_thumbnail) {
              $types = $this->thumbnailTypes;
  
              if ($this->thumbnailType !== 'auto') {
                  array_unshift($types, $this->thumbnailType);
              }
  
              foreach ($types as $type) {
                  $thumb = $this->get('thumbnails.' . $type, false);
  
                  if ($thumb) {
                      $thumb = $thumb instanceof ThumbnailImageMedium ? $thumb : MediumFactory::fromFile($thumb, ['type' => 'thumbnail']);
                      $thumb->parent = $this;
                  }
  
                  if ($thumb) {
                      $this->_thumbnail = $thumb;
                      break;
                  }
              }
          }
  
          return $this->_thumbnail;
      }
code: protected function getThumbnail()
      {
          if (!$this->_thumbnail) {
              $types = $this->thumbnailTypes;
  
              if ($this->thumbnailType !== 'auto') {
                  array_unshift($types, $this->thumbnailType);
              }
  
              foreach ($types as $type) {
                  $thumb = $this->get('thumbnails.' . $type, false);
  
                  if ($thumb) {
                      $thumb = $thumb instanceof ThumbnailImageMedium ? $thumb : MediumFactory::fromFile($thumb, ['type' => 'thumbnail']);
                      $thumb->parent = $this;
                  }
  
                  if ($thumb) {
                      $this->_thumbnail = $thumb;
                      break;
                  }
              }
          }
  
          return $this->_thumbnail;
      }
code_tokens: protected function getThumbnail ( ) { if ( ! $ this -> _thumbnail ) { $ types = $ this -> thumbnailTypes ; if ( $ this -> thumbnailType !== 'auto' ) { array_unshift ( $ types , $ this -> thumbnailType ) ; } foreach ( $ types as $ type ) { $ thumb = $ this -> get ( 'thumbnails.' . $ type , false ) ; if ( $ thumb ) { $ thumb = $ thumb instanceof ThumbnailImageMedium ? $ thumb : MediumFactory :: fromFile ( $ thumb , [ 'type' => 'thumbnail' ] ) ; $ thumb -> parent = $ this ; } if ( $ thumb ) { $ this -> _thumbnail = $ thumb ; break ; } } } return $ this -> _thumbnail ; }
docstring: Get the thumbnail Medium object
  
  @return ThumbnailImageMedium
docstring_tokens: Get the thumbnail Medium object