Code Duplication    Length = 78-83 lines in 3 locations

src/MetadataV3/edmx/TConnectionType.php 1 location

@@ 13-91 (lines=79) @@
10
 *
11
 * XSD Type: TConnection
12
 */
13
class TConnectionType extends IsOK
14
{
15
16
    /**
17
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet
18
     */
19
    private $designerInfoPropertySet = [];
20
21
    /**
22
     * Adds as designerProperty
23
     *
24
     * @return self
25
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType $designerProperty
26
     */
27
    public function addToDesignerInfoPropertySet(TDesignerPropertyType $designerProperty)
28
    {
29
        $this->designerInfoPropertySet[] = $designerProperty;
30
        return $this;
31
    }
32
33
    /**
34
     * isset designerInfoPropertySet
35
     *
36
     * @param scalar $index
37
     * @return boolean
38
     */
39
    public function issetDesignerInfoPropertySet($index)
40
    {
41
        return isset($this->designerInfoPropertySet[$index]);
42
    }
43
44
    /**
45
     * unset designerInfoPropertySet
46
     *
47
     * @param scalar $index
48
     * @return void
49
     */
50
    public function unsetDesignerInfoPropertySet($index)
51
    {
52
        unset($this->designerInfoPropertySet[$index]);
53
    }
54
55
    /**
56
     * Gets as designerInfoPropertySet
57
     *
58
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[]
59
     */
60
    public function getDesignerInfoPropertySet()
61
    {
62
        return $this->designerInfoPropertySet;
63
    }
64
65
    /**
66
     * Sets a new designerInfoPropertySet
67
     *
68
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet
69
     * @return self
70
     */
71
    public function setDesignerInfoPropertySet(array $designerInfoPropertySet)
72
    {
73
        $this->designerInfoPropertySet = $designerInfoPropertySet;
74
        return $this;
75
    }
76
77
    public function isOK(&$msg = null)
78
    {
79
        if (!$this->isValidArray(
80
            $this->designerInfoPropertySet,
81
            '\AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType'
82
        )) {
83
            $msg = "Designer info property set not a valid array";
84
            return false;
85
        }
86
        if (!$this->isChildArrayOK($this->designerInfoPropertySet, $msg)) {
87
            return false;
88
        }
89
        return true;
90
    }
91
}
92

src/MetadataV3/edmx/TOptionsType.php 1 location

@@ 13-90 (lines=78) @@
10
 *
11
 * XSD Type: TOptions
12
 */
13
class TOptionsType extends IsOK
14
{
15
16
    /**
17
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet
18
     */
19
    private $designerInfoPropertySet = [];
20
21
    /**
22
     * Adds as designerProperty
23
     *
24
     * @return self
25
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType $designerProperty
26
     */
27
    public function addToDesignerInfoPropertySet(TDesignerPropertyType $designerProperty)
28
    {
29
        $this->designerInfoPropertySet[] = $designerProperty;
30
        return $this;
31
    }
32
33
    /**
34
     * isset designerInfoPropertySet
35
     *
36
     * @param scalar $index
37
     * @return boolean
38
     */
39
    public function issetDesignerInfoPropertySet($index)
40
    {
41
        return isset($this->designerInfoPropertySet[$index]);
42
    }
43
44
    /**
45
     * unset designerInfoPropertySet
46
     *
47
     * @param scalar $index
48
     * @return void
49
     */
50
    public function unsetDesignerInfoPropertySet($index)
51
    {
52
        unset($this->designerInfoPropertySet[$index]);
53
    }
54
55
    /**
56
     * Gets as designerInfoPropertySet
57
     *
58
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[]
59
     */
60
    public function getDesignerInfoPropertySet()
61
    {
62
        return $this->designerInfoPropertySet;
63
    }
64
65
    /**
66
     * Sets a new designerInfoPropertySet
67
     *
68
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet
69
     * @return self
70
     */
71
    public function setDesignerInfoPropertySet(array $designerInfoPropertySet)
72
    {
73
        $this->designerInfoPropertySet = $designerInfoPropertySet;
74
        return $this;
75
    }
76
77
    public function isOK(&$msg = null)
78
    {
79
        if (!$this->isValidArray(
80
            $this->designerInfoPropertySet,
81
            '\AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType'
82
        )) {
83
            $msg = "Designer info property set not a valid array";
84
            return false;
85
        }
86
        if (!$this->isChildArrayOK($this->designerInfoPropertySet, $msg)) {
87
            return false;
88
        }
89
    }
90
}
91

src/MetadataV3/mapping/cs/Groups/TResultBindingGroup.php 1 location

@@ 8-90 (lines=83) @@
5
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
6
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TResultBindingType;
7
8
trait TResultBindingGroup
9
{
10
    //Grouping for result bindings in function mappings
11
    use IsOKToolboxTrait;
12
13
    /**
14
     * @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TResultBindingType[] $resultBinding
15
     */
16
    private $resultBinding = [];
17
18
    /*
19
     * Adds as resultBinding
20
     *
21
     * @return self
22
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TResultBindingType $resultBinding
23
     */
24
    public function addToResultBinding(TResultBindingType $resultBinding)
25
    {
26
        $this->resultBinding[] = $resultBinding;
27
        return $this;
28
    }
29
30
    /**
31
     * isset resultBinding
32
     *
33
     * @param scalar $index
34
     * @return boolean
35
     */
36
    public function issetResultBinding($index)
37
    {
38
        return isset($this->resultBinding[$index]);
39
    }
40
41
    /**
42
     * unset resultBinding
43
     *
44
     * @param scalar $index
45
     * @return void
46
     */
47
    public function unsetResultBinding($index)
48
    {
49
        unset($this->resultBinding[$index]);
50
    }
51
52
    /**
53
     * Gets as resultBinding
54
     *
55
     * @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TResultBindingType[]
56
     */
57
    public function getResultBinding()
58
    {
59
        return $this->resultBinding;
60
    }
61
62
    /**
63
     * Sets a new resultBinding
64
     *
65
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TResultBindingType[] $resultBinding
66
     * @return self
67
     */
68
    public function setResultBinding(array $resultBinding)
69
    {
70
        $this->resultBinding = $resultBinding;
71
        return $this;
72
    }
73
74
    public function isResultBindingGroupOK(&$msg = null)
75
    {
76
        if (!$this->isValidArray(
77
            $this->resultBinding,
78
            '\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType'
79
        )) {
80
            $msg = "Scalar property array not a valid array";
81
            return false;
82
        }
83
        if (!$this->isChildArrayOK($this->resultBinding, $msg)) {
84
            return false;
85
        }
86
87
        return true;
88
    }
89
90
}
91