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/UserBundle/Entity/User.php 1 location

@@ 1604-1616 (lines=13) @@
1601
     *
1602
     * @return $this
1603
     */
1604
    public function setCurrentUrl(AccessUrl $url)
1605
    {
1606
        $urlList = $this->getPortals();
1607
        /** @var AccessUrlRelUser $item */
1608
        foreach ($urlList as $item) {
1609
            if ($item->getPortal()->getId() == $url->getId()) {
1610
                $this->currentUrl = $url;
1611
                break;
1612
            }
1613
        }
1614
1615
        return $this;
1616
    }
1617
1618
    /**
1619
     * @return AccessUrl

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

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