diff options
author | Fbenas <philbeansburton@gmail.com> | 2018-05-07 14:42:15 +0100 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2018-05-07 14:42:15 +0100 |
commit | 33f00442f1667d57f94433834e0da4985670025b (patch) | |
tree | aa65df03e719f3d8024b0ea42a62aa7fd61f196e /src/Script/Output.php | |
parent | c223ab602cbe7f6db7321ba547164971d63d7bcd (diff) |
Get filtering working with output
Diffstat (limited to 'src/Script/Output.php')
-rw-r--r-- | src/Script/Output.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Script/Output.php b/src/Script/Output.php index e69de29..8f7a689 100644 --- a/src/Script/Output.php +++ b/src/Script/Output.php @@ -0,0 +1,23 @@ +<?php + +namespace App\Script; + +use App\Model\Collection; + +class Output +{ + public function printCollection(Collection $collection) + { + if (count($collection) === 0) { + echo "No results found\n"; + return; + } + + $out = []; + foreach ($collection as $vendor) { + $out[] = implode("\n", $vendor->toString()); + } + + echo implode("\n\n", $out) . "\n"; + } +} |