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

@@ 2498-2510 (lines=13) @@
2495
     *
2496
     * @return $this
2497
     */
2498
    public function setCurrentUrl(AccessUrl $url)
2499
    {
2500
        $urlList = $this->getPortals();
2501
        /** @var AccessUrlRelUser $item */
2502
        foreach ($urlList as $item) {
2503
            if ($item->getPortal()->getId() == $url->getId()) {
2504
                $this->currentUrl = $url;
2505
                break;
2506
            }
2507
        }
2508
2509
        return $this;
2510
    }
2511
2512
    /**
2513
     * @return AccessUrl