Code Duplication    Length = 23-23 lines in 2 locations

eZ/Publish/Core/Repository/Values/User/User.php 1 location

@@ 136-158 (lines=23) @@
133
     *
134
     * @return mixed
135
     */
136
    public function __get($property)
137
    {
138
        switch ($property) {
139
            case 'contentInfo':
140
                return $this->getVersionInfo()->getContentInfo();
141
142
            case 'id':
143
                $versionInfo = $this->getVersionInfo();
144
                if (empty($versionInfo)) {
145
                    return null;
146
                }
147
148
                return $versionInfo->getContentInfo()->id;
149
150
            case 'versionInfo':
151
                return $this->getVersionInfo();
152
153
            case 'fields':
154
                return $this->getFields();
155
        }
156
157
        return parent::__get($property);
158
    }
159
160
    /**
161
     * Magic isset for signaling existence of convenience properties.

eZ/Publish/Core/Repository/Values/User/UserGroup.php 1 location

@@ 116-138 (lines=23) @@
113
     *
114
     * @return mixed
115
     */
116
    public function __get($property)
117
    {
118
        switch ($property) {
119
            case 'contentInfo':
120
                return $this->getVersionInfo()->getContentInfo();
121
122
            case 'id':
123
                $versionInfo = $this->getVersionInfo();
124
                if (empty($versionInfo)) {
125
                    return null;
126
                }
127
128
                return $versionInfo->getContentInfo()->id;
129
130
            case 'versionInfo':
131
                return $this->getVersionInfo();
132
133
            case 'fields':
134
                return $this->getFields();
135
        }
136
137
        return parent::__get($property);
138
    }
139
140
    /**
141
     * Magic isset for signaling existence of convenience properties.