original_string: public function attachFile($id, $table, \Symfony\Component\HttpFoundation\File\UploadedFile $file)
      {
          $newFileName = md5(microtime() . '.' . strtolower($file->getClientOriginalExtension()));
          $relativePath = $table . '/' . date('Y/m/d');
          $relativeFilePath = $relativePath . '/' . $newFileName;
          $dstPath = APP_UPLOADS_DIR . '/' . $relativePath;
          $file->move($dstPath, $newFileName);
          $pic = new \Towel\Model\Pic();
  
          $pic->object_id = $id;
          $pic->object_type = $table;
          $pic->pic = $relativeFilePath;
          $pic->created = time();
          $pic->save();
      }
code: public function attachFile($id, $table, \Symfony\Component\HttpFoundation\File\UploadedFile $file)
      {
          $newFileName = md5(microtime() . '.' . strtolower($file->getClientOriginalExtension()));
          $relativePath = $table . '/' . date('Y/m/d');
          $relativeFilePath = $relativePath . '/' . $newFileName;
          $dstPath = APP_UPLOADS_DIR . '/' . $relativePath;
          $file->move($dstPath, $newFileName);
          $pic = new \Towel\Model\Pic();
  
          $pic->object_id = $id;
          $pic->object_type = $table;
          $pic->pic = $relativeFilePath;
          $pic->created = time();
          $pic->save();
      }
code_tokens: public function attachFile ( $ id , $ table , \ Symfony \ Component \ HttpFoundation \ File \ UploadedFile $ file ) { $ newFileName = md5 ( microtime ( ) . '.' . strtolower ( $ file -> getClientOriginalExtension ( ) ) ) ; $ relativePath = $ table . '/' . date ( 'Y/m/d' ) ; $ relativeFilePath = $ relativePath . '/' . $ newFileName ; $ dstPath = APP_UPLOADS_DIR . '/' . $ relativePath ; $ file -> move ( $ dstPath , $ newFileName ) ; $ pic = new \ Towel \ Model \ Pic ( ) ; $ pic -> object_id = $ id ; $ pic -> object_type = $ table ; $ pic -> pic = $ relativeFilePath ; $ pic -> created = time ( ) ; $ pic -> save ( ) ; }
docstring: It will attach the file.
  
  @param $id
  @param $table
  @param \Symfony\Component\HttpFoundation\File\UploadedFile $file
docstring_tokens: It will attach the file .