From b10e4aa662d486b26166a1b409945376cb8a79c4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 18 Jul 2020 17:08:55 +0400 Subject: Added example of get programs Signed-off-by: Valentin Popov --- examples/get-programs.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 examples/get-programs.php (limited to 'examples/get-programs.php') diff --git a/examples/get-programs.php b/examples/get-programs.php new file mode 100644 index 0000000..9dbe581 --- /dev/null +++ b/examples/get-programs.php @@ -0,0 +1,38 @@ +getChannels(); +$channel = array_shift($channels); + +# Using presenter +$presenter = ServicePresenter::create($environment); +$current_week = date('Y-m-d', strtotime('this week')); +$programs = $presenter->getPrograms($channel->id, $current_week); + +# Or using repository +$current_week = date('Y-m-d', strtotime('this week')); +$repository = ProgramRepository::create($environment, $channel->id, $current_week); +$programs = $repository->get(); -- cgit v1.2.3