]> git.mjollnir.org Git - moodle.git/commitdiff
portfolio: MDL-21030 added helper function to add multiple attachments
authorPenny Leach <penny@mjollnir.org>
Fri, 18 Dec 2009 10:52:11 +0000 (11:52 +0100)
committerPenny Leach <penny@mjollnir.org>
Fri, 18 Dec 2009 10:52:11 +0000 (11:52 +0100)
lib/portfolio/formats/leap2a/lib.php

index 0926a69576af81d8c5854620710d2b7800affaf4..b5006f90625feff9d263d816c42e651d439efa44 100644 (file)
@@ -331,6 +331,16 @@ class portfolio_format_leap2a_entry {
         $this->attachments[$file->get_id()] = $file;
     }
 
+    /**
+     * helper function to add a bunch of files at the same time
+     * useful for passing $this->multifiles straight through from the portfolio_caller
+     */
+    public function add_attachments(array $files) {
+        foreach ($files as $file) {
+            $this->add_attachment($file);
+        }
+    }
+
     /**
      * add a category to this entry
      * http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories