From ed986e0082d9004dd777cc2e87a1de5bdbb683cf Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Fri, 18 Dec 2009 13:44:23 +0000 Subject: [PATCH] portfolio: MDL-21030 added helper function to add multiple attachments --- lib/portfolio/formats/leap2a/lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/portfolio/formats/leap2a/lib.php b/lib/portfolio/formats/leap2a/lib.php index 0926a69576..b5006f9062 100644 --- a/lib/portfolio/formats/leap2a/lib.php +++ b/lib/portfolio/formats/leap2a/lib.php @@ -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 -- 2.39.5