From 08858685c568914669d38f7abdcf98abf0247696 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 3 Feb 2016 09:43:02 -0500 Subject: [PATCH] add find_all function to Storage --- web/includes/Storage.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/includes/Storage.php b/web/includes/Storage.php index 7928fe041..1820b977d 100644 --- a/web/includes/Storage.php +++ b/web/includes/Storage.php @@ -36,5 +36,14 @@ class Storage { #call_user_func_array( $this->{$fn}, $args); } } + public static function find_all() { + $storage_areas = array(); + $result = dbQuery( 'SELECT * FROM Storage ORDER BY Name'); + $results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Storage' ); + foreach ( $results as $row => $obj ) { + $storage_areas[] = $obj; + } + return $storage_areas; + } } ?>