AuditLogVariable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 5
Bugs 2 Features 1
Metric Value
wmc 2
c 5
b 2
f 1
lcom 0
cbo 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A log() 0 4 1
A view() 0 4 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