original_string: protected function validateUploadImages($entity)
      {
          $files = $this->request->file('files');
  
          if (empty($files['name'][0])) {
              return null;
          }
  
          $directory = $this->config->get("{$entity}_image_dirname", $entity);
          $results = $this->file_transfer->uploadMultiple($files, 'image', "image/upload/$directory");
  
          foreach ($results['transferred'] as $key => $path) {
              $this->setSubmitted("images.$key.path", $path);
          }
  
          if (!empty($results['errors'])) {
              $this->setError('images', implode('<br>', (array) $results['errors']));
              return false;
          }
  
          return true;
      }
code: protected function validateUploadImages($entity)
      {
          $files = $this->request->file('files');
  
          if (empty($files['name'][0])) {
              return null;
          }
  
          $directory = $this->config->get("{$entity}_image_dirname", $entity);
          $results = $this->file_transfer->uploadMultiple($files, 'image', "image/upload/$directory");
  
          foreach ($results['transferred'] as $key => $path) {
              $this->setSubmitted("images.$key.path", $path);
          }
  
          if (!empty($results['errors'])) {
              $this->setError('images', implode('<br>', (array) $results['errors']));
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateUploadImages ( $ entity ) { $ files = $ this -> request -> file ( 'files' ) ; if ( empty ( $ files [ 'name' ] [ 0 ] ) ) { return null ; } $ directory = $ this -> config -> get ( "{$entity}_image_dirname" , $ entity ) ; $ results = $ this -> file_transfer -> uploadMultiple ( $ files , 'image' , "image/upload/$directory" ) ; foreach ( $ results [ 'transferred' ] as $ key => $ path ) { $ this -> setSubmitted ( "images.$key.path" , $ path ) ; } if ( ! empty ( $ results [ 'errors' ] ) ) { $ this -> setError ( 'images' , implode ( '<br>' , ( array ) $ results [ 'errors' ] ) ) ; return false ; } return true ; }
docstring: Validates uploaded images
  @param string $entity
  @return bool|null
docstring_tokens: Validates uploaded images