flatbase icon indicating copy to clipboard operation
flatbase copied to clipboard

How to use a Flatbase\Collection ?

Open moeenio opened this issue 5 years ago • 2 comments

Complete noob, how do you iterate through all records from a Flatbase\Collection you've got with a query like this one?

$userthingies = $flatbase->read()->in("thingies")
    ->where("author", "=", $_SESSION["user"])
    ->get();

moeenio avatar May 07 '20 12:05 moeenio

@adamnicholson @carlwhittick

moeenio avatar May 07 '20 12:05 moeenio

I have figured it out, thanks to this thing.

foreach ($userthingies as $key => $thingie) {
        echo "<li>{$thingie["name"]} <small>{$thingie["description"]}</small> by {$thingie["author"]}</li>";
      }

I think the docs could be improved about this tho.

moeenio avatar May 07 '20 13:05 moeenio