Code Duplication    Length = 13-13 lines in 3 locations

src/Chamilo/CoreBundle/Entity/Course.php 1 location

@@ 1296-1308 (lines=13) @@
1293
     *
1294
     * @return $this
1295
     */
1296
    public function setCurrentUrl(AccessUrl $url)
1297
    {
1298
        $urlList = $this->getUrls();
1299
        /** @var AccessUrlRelCourse $item */
1300
        foreach ($urlList as $item) {
1301
            if ($item->getUrl()->getId() == $url->getId()) {
1302
                $this->currentUrl = $url;
1303
                break;
1304
            }
1305
        }
1306
1307
        return $this;
1308
    }
1309
1310
    /**
1311
     * @return AccessUrl

src/Chamilo/CoreBundle/Entity/Session.php 1 location

@@ 1114-1126 (lines=13) @@
1111
     *
1112
     * @return $this
1113
     */
1114
    public function setCurrentUrl(AccessUrl $url)
1115
    {
1116
        $urlList = $this->getUrls();
1117
        /** @var AccessUrlRelCourse $item */
1118
        foreach ($urlList as $item) {
1119
            if ($item->getUrl()->getId() == $url->getId()) {
1120
                $this->currentUrl = $url;
1121
                break;
1122
            }
1123
        }
1124
1125
        return $this;
1126
    }
1127
1128
    /**
1129
     * @return AccessUrl

src/Chamilo/UserBundle/Entity/User.php 1 location

@@ 2304-2316 (lines=13) @@
2301
     *
2302
     * @return $this
2303
     */
2304
    public function setCurrentUrl(AccessUrl $url)
2305
    {
2306
        $urlList = $this->getPortals();
2307
        /** @var AccessUrlRelUser $item */
2308
        foreach ($urlList as $item) {
2309
            if ($item->getPortal()->getId() == $url->getId()) {
2310
                $this->currentUrl = $url;
2311
                break;
2312
            }
2313
        }
2314
2315
        return $this;
2316
    }
2317
2318
    /**
2319
     * @return AccessUrl