Code Duplication    Length = 18-18 lines in 2 locations

api/midgard/reflection/property.php 2 locations

@@ 95-112 (lines=18) @@
92
     * @param string $property
93
     * @return string|NULL
94
     */
95
    public function get_link_name($property)
96
    {
97
        if ($this->cm->hasAssociation($property)) {
98
            $mapping = $this->cm->getAssociationMapping($property);
99
            return $mapping['midgard:link_name'];
100
        }
101
        $mapping = $this->get_mapping($property);
102
        if (is_null($mapping)) {
103
            return null;
104
        }
105
        if (isset($mapping["noidlink"]["target"])) {
106
            return $mapping["noidlink"]["target"];
107
        }
108
        return null;
109
    }
110
111
    /**
112
     * Returns the target field name
113
     *
114
     * @param string $property
115
     * @return string|NULL
@@ 117-134 (lines=18) @@
114
     * @param string $property
115
     * @return string|NULL
116
     */
117
    public function get_link_target($property)
118
    {
119
        if ($this->cm->hasAssociation($property)) {
120
            $mapping = $this->cm->getAssociationMapping($property);
121
            return $mapping['midgard:link_target'];
122
        }
123
        $mapping = $this->get_mapping($property);
124
        if (is_null($mapping)) {
125
            return null;
126
        }
127
        if (isset($mapping["noidlink"]["field"])) {
128
            return $mapping["noidlink"]["field"];
129
        }
130
        return null;
131
    }
132
133
    /**
134
     * Returns field type constant
135
     *
136
     * @param string $property
137
     * @return integer