AuditLogVariable::log()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Craft;
4
5
/**
6
 * Audit Log variable.
7
 *
8
 * Injects functions in templates
9
 *
10
 * @author    Bob Olde Hampsink <[email protected]>
11
 * @copyright Copyright (c) 2015, author
12
 * @license   http://buildwithcraft.com/license Craft License Agreement
13
 *
14
 * @link      http://github.com/boboldehampsink
15
 */
16
class AuditLogVariable
17
{
18
    /**
19
     * Show log with critiera.
20
     *
21
     * @param array $criteria
22
     *
23
     * @return array
24
     */
25
    public function log($criteria)
26
    {
27
        return craft()->auditLog->log((object) $criteria);
28
    }
29
30
    /**
31
     * Show a specific log item.
32
     *
33
     * @param int $id
34
     *
35
     * @return AuditLogModel
36
     */
37
    public function view($id)
38
    {
39
        return craft()->auditLog->view($id);
40
    }
41
}
42