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

Navigation::toView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
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