Completed
Branch master (7a03a0)
by Karsten
03:22 queued 35s
created

CollectionMapper::getNested()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
/**
3
 * File was created 11.05.2016 10:13
4
 */
5
6
namespace PeekAndPoke\Component\Slumber\Core\Codec\Property;
7
8
use PeekAndPoke\Component\Slumber\Annotation\Slumber\AsCollection;
9
use PeekAndPoke\Component\Slumber\Core\Codec\Mapper;
10
11
/**
12
 * @author Karsten J. Gerber <[email protected]>
13
 */
14
interface CollectionMapper extends Mapper
15
{
16
    /**
17
     * @return AsCollection
18
     */
19
    public function getOptions();
20
21
    /**
22
     * @return Mapper
23
     */
24
    public function getNested();
25
26
    /**
27
     * @param Mapper $nested
28
     *
29
     * @return $this
30
     */
31
    public function setNested(Mapper $nested);
32
33
    /**
34
     * Traverse multiple nested Collection mappers, find the leave and check its type.
35
     *
36
     * @param string $class
37
     *
38
     * @return bool
39
     */
40
    public function isLeaveOfType($class);
41
42
    /**
43
     * Traverse multiple nested Collection mappers, and find the leave.
44
     *
45
     * @return Mapper
46
     */
47
    public function getLeaf();
48
49
    /**
50
     * Traverse multiple nested Collection mappers, and replace the leave.
51
     *
52
     * @param Mapper $leave
53
     */
54
    public function setLeaf(Mapper $leave);
55
56
    /**
57
     * @return null|CollectionMapper
58
     */
59
    public function getLeafParent();
60
61
    /**
62
     * @param string $collectionClass
63
     *
64
     * @return $this
65
     */
66
    public function setLeafParentsCollectionType($collectionClass);
67
68
    /**
69
     * Get the nesting level.
70
     *
71
     * If there is no nested element the level is 0.
72
     * If there is a nested element the level is 1.
73
     * If there is a nested element with a nested element as well the level 2.
74
     *
75
     * ... and so forth
76
     *
77
     * @return int
78
     */
79
    public function getNestingLevel();
80
}
81