/**
  * 
  * Erstellt ein neues Yumpu ePaper
  * @param string $file_to_import
  * @param string $title
  * @param description $description
  * @throws YumpuEpaper_repository_exception
  */
 public static function create($file_to_import, $title, $description = "")
 {
     global $wpdb;
     $table_name = $wpdb->prefix . 'yumpu_documents';
     if (strlen($title) < 5 || strlen($title) > 255) {
         throw new YumpuEpaper_repository_exception("need title - Min. length 5 characters, max. length 255 characters");
     }
     if (!empty($description) && strlen($description) < 5) {
         throw new YumpuEpaper_repository_exception("description to short - Min. length 5 characters, max. length 2500 characters");
     }
     if (!empty($description) && strlen($description) > 2500) {
         throw new YumpuEpaper_repository_exception("description to long - Min. length 5 characters, max. length 2500 characters");
     }
     if (empty($description)) {
         $description = null;
     }
     //Nun übertragen wir die Daten an YUMPU
     $YAPI = new YumpuAPI(WP_Yumpu::$API_TOKEN);
     try {
         $result = $YAPI->document_add($file_to_import, $title, $description);
         $source_filename = basename($file_to_import);
         /**
          * Es hat bisher alles geklappt, daher speichern wir die Daten nun in die Datenbank
          */
         $qry = sprintf('INSERT INTO ' . $table_name . ' (progress_id, title, description, source_filename, status) VALUES (\'%s\', \'%s\', \'%s\', \'%s\', \'%s\')', $result->progress_id, $title, $description, $source_filename, 'progress');
         $wpdb->query($qry);
         return $wpdb->insert_id;
     } catch (YumpuAPI_Exception $e) {
         // Eigentlich nicht so toll Exception aus einem Try/Catch werfen
         // Könnte man besser lösen.
         throw new YumpuEpaper_repository_exception(implode("<br>", $YAPI->get_errors()));
     }
 }