code: public function setAllowedTypes($types)
      {
          if (is_array($types)) {
              $types = implode(',', $types);
          }
  
          return $this->setAttribute('data-allowedtypes', $types);
      }
docs: Sets the allowed mime types.
  The types can be passed either as an array or a comma separated list.
  
  @param array|string $types
  
  @return self