Completed
Push — master ( 585f2b...0f3816 )
by Vitaly
02:39
created

Navigation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toView() 0 4 1
A materialsHandlers() 0 4 1
1
<?php
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>
4
 * on 07.08.14 at 17:11
5
 */
6
namespace samsoncms\api;
7
8
use samson\activerecord\structure;
9
10
/**
11
 * SamsonCMS Navigation element
12
 * @author Vitaly Egorov <[email protected]>
13
 * @copyright 2014 SamsonOS
14
 */
15
class Navigation extends structure
16
{
17
    /** @var string Navigation string identifier */
18
    public $Url;
19
20
    /** @var self[] Collection of child items */
21
    public $children = array();
22
23
    /**
24
     * Override standard view passing
25
     * @param string $prefix Prefix
26
     * @param array $restricted Collection of ignored entity fields
27
     * @return array Filled collection of key => values for view
28
     */
29
    public function toView($prefix = '', array $restricted = array())
30
    {
31
        return parent::toView($prefix, $restricted = array('parent', 'parents', 'children'));
32
    }
33
34
    /**
35
     * Material query injection
36
     * @param \samson\activerecord\dbQuery $query Query object
37
     */
38
    public function materialsHandlers(&$query)
39
    {
40
        $query->join('gallery');
41
    }
42
}
43