From c4a005a69a854682f064016d428d23e50c6e9dee Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 15 Dec 2018 16:23:19 +0100 Subject: Flywheel extension and custom json formatter --- app/class/wflywheel/repository.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 app/class/wflywheel/repository.php (limited to 'app/class/wflywheel/repository.php') diff --git a/app/class/wflywheel/repository.php b/app/class/wflywheel/repository.php new file mode 100644 index 0000000..baad42e --- /dev/null +++ b/app/class/wflywheel/repository.php @@ -0,0 +1,30 @@ +formatter->getFileExtension(); + $files = glob($this->path . DIRECTORY_SEPARATOR . '*.' . $ext); + return $files; + } + + /** + * Get an array containing the id of all files in this repository + * + * @return array An array, item is a id + */ + public function getAllIds() + { + $ext = $this->formatter->getFileExtension(); + return array_map(function($path) use ($ext) { + return $this->getIdFromPath($path, $ext); + }, $this->getAllFiles()); + } +} -- cgit v1.2.3