From 33f00442f1667d57f94433834e0da4985670025b Mon Sep 17 00:00:00 2001 From: Fbenas Date: Mon, 7 May 2018 14:42:15 +0100 Subject: Get filtering working with output --- src/Script/Console.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/Script/Console.php') diff --git a/src/Script/Console.php b/src/Script/Console.php index bedbc1d..e1d7df5 100644 --- a/src/Script/Console.php +++ b/src/Script/Console.php @@ -2,9 +2,9 @@ namespace App\Script; -// use App\Model\Vendor; +use App\Model\Vendor; use App\Script\Input; -// use App\Script\Output; +use App\Script\Output; /** * Main application class @@ -32,6 +32,9 @@ class Console { // Define the root of the application define('APP_ROOT', realpath(dirname(__FILE__) . '/../../') . '/'); + + // Set default tiemzone + date_default_timezone_set('Europe/London'); } /** @@ -41,12 +44,12 @@ class Console */ public function exec() { - $vendors = Vendor::loadAll(); $input = new Input; + $vendors = Vendor::loadAll($input->getOption('f')); $vendors->filterByInput($input); - // $output = new Output; - // - // $output->printCollection($vendors); + + $output = new Output; + $output->printCollection($vendors); } } -- cgit v1.2.3