summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/File.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/Model/File.php b/app/Model/File.php
index f069c8cf..46710658 100644
--- a/app/Model/File.php
+++ b/app/Model/File.php
@@ -111,6 +111,38 @@ class File extends Base
->asc('name')
->findAll();
}
+
+ /**
+ * Get all images for a given task
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return array
+ */
+ public function getAllImages($task_id)
+ {
+ return $this->db->table(self::TABLE)
+ ->eq('task_id', $task_id)
+ ->eq('is_image', 1)
+ ->asc('name')
+ ->findAll();
+ }
+
+ /**
+ * Get all files without images for a given task
+ *
+ * @access public
+ * @param integer $task_id Task id
+ * @return array
+ */
+ public function getAllDocuments($task_id)
+ {
+ return $this->db->table(self::TABLE)
+ ->eq('task_id', $task_id)
+ ->eq('is_image', 0)
+ ->asc('name')
+ ->findAll();
+ }
/**
* Check if a filename is an image