Implement download entity and related stuff. Will build things like user quota on...
[rock.divinelegy.git] / Controllers / DownloadTestController.php
1 <?php
2
3 namespace Controllers;
4
5 use Controllers\IDivineController;
6 use DataAccess\IDownloadRepository;
7 use DataAccess\Queries\DownloadQueryConstraints;
8 use DateTime;
9
10 class DownloadTestController implements IDivineController
11 {
12 private $_downloadRepository;
13
14 public function __construct(
15 IDownloadRepository $repository
16 ) {
17 $this->_downloadRepository = $repository;
18 }
19
20 public function indexAction() {
21 $start = new DateTime('0:00 today');
22 $end = new DateTime();
23
24 $constraints = new DownloadQueryConstraints();
25 $constraints->inDateRange($start, $end);
26 $downloads = $this->_downloadRepository->findByUserId(4, $constraints);
27
28 echo '<pre>';
29 print_r($downloads);
30 echo '</pre>';
31 }
32 }