Completed
Push — master ( 0f3816...ff883c )
by Vitaly
02:34
created

Navigation::materialsHandlers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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 entity
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, array_merge($this->restricted, array('parent', 'parents', 'children')));
32
    }
33
}
34