Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2017 (original work) Open Assessment Technologies SA;
19 *
20 *
21 */
22
23namespace oat\taoEventLog\model\requestLog;
24
25/**
26 * Interface RequestLogStorage
27 * @package oat\taoEventLog\model\requestLog
28 * @author Aleh Hutnikau, <hutnikau@1pt.com>
29 */
30interface RequestLogStorageReadable extends RequestLogStorageWritable
31{
32    /**
33     * Find user requests.
34     *
35     * Result example:
36     * ```
37     * [
38     *     [...],
39     *     [
40     *         'user_id' => 'http://sample/first.rdf#i1490617729993174',
41     *         'user_role' => 'http://www.tao.lu/Ontologies/TAO.rdf#BackOfficeRole,http://www.tao.lu/Ontologies/TAOLTI.rdf#LtiDeliveryProviderManagerRole',
42     *         'action' => '/tao/Main/index?structure=settings&ext=tao&section=settings_ext_mng',
43     *         'event_time' => '1490617792.5479',
44     *         'details' => '"{\"login\":\"proctor\"}"', //json encoded additional data
45     *     ],
46     *     [...],
47     * ]
48     * ```
49     *
50     * Filters parameter example:
51     * ```
52     * [
53     *   ['user_id', 'in', ['http://sample/first.rdf#i1490617729993174', 'http://sample/first.rdf#i1490617729993174'],
54     *   ['event_time', 'between', '1490703795.3624', '1490704796.2467'],
55     *   ['action', '=', '/tao/Main/login'],
56     * ]
57     * ```
58     * Available operations: `<`, `>`, `<>`, `<=`, `>=`, `=`, `between`, `like`
59     *
60     * Options parameter example:
61     * ```
62     * [
63     *      'limit' => 100,
64     *      'offset' => 200,
65     *      'group' => 'user_id,
66     * ]
67     * ```
68     * @param array $filters filters by user id, url, role etc.
69     * @param array $options
70     * @return \Iterator
71     */
72    public function find(array $filters = [], array $options = []);
73
74    /**
75     * Count number of records by given search criteria
76     * Options parameter example:
77     * ```
78     * [
79     *      'group' => 'user_id,
80     * ]
81     * ```
82     *
83     * @param array $filters @see self::find() description.
84     * @param array $options
85     * @return integer
86     */
87    public function count(array $filters = [], array $options = []);
88}