|
1 | 1 | <?php
|
2 | 2 | /* For licensing terms, see /license.txt */
|
3 | 3 |
|
| 4 | +use Chamilo\CoreBundle\Entity\AccessUrlRelSession; |
4 | 5 | use Chamilo\CoreBundle\Entity\ExtraField;
|
| 6 | +use Chamilo\CoreBundle\Entity\ExtraFieldRelTag; |
| 7 | +use Chamilo\CoreBundle\Entity\ExtraFieldValues; |
| 8 | +use Chamilo\CoreBundle\Entity\SequenceResource; |
| 9 | +use Chamilo\CoreBundle\Entity\Session; |
| 10 | +use Chamilo\CoreBundle\Entity\SessionRelCourse; |
| 11 | +use Chamilo\CoreBundle\Entity\Tag; |
5 | 12 | use Chamilo\CoreBundle\Entity\User;
|
6 | 13 | use Chamilo\CoreBundle\Framework\Container;
|
7 | 14 | use Chamilo\CoreBundle\Event\AbstractEvent;
|
@@ -732,14 +739,14 @@ public static function browseSessions($date = null, $limit = [], $returnQueryBui
|
732 | 739 |
|
733 | 740 | $qb = $qb
|
734 | 741 | ->select('s')
|
735 |
| - ->from('ChamiloCoreBundle:Session', 's') |
| 742 | + ->from(Session::class, 's') |
736 | 743 | ->where(
|
737 | 744 | $qb->expr()->in(
|
738 | 745 | 's',
|
739 | 746 | $qb2
|
740 | 747 | ->select('s2')
|
741 |
| - ->from('ChamiloCoreBundle:AccessUrlRelSession', 'url') |
742 |
| - ->join('ChamiloCoreBundle:Session', 's2') |
| 748 | + ->from(AccessUrlRelSession::class, 'url') |
| 749 | + ->join(Session::class, 's2') |
743 | 750 | ->where(
|
744 | 751 | $qb->expr()->eq('url.sessionId ', 's2.id')
|
745 | 752 | )->andWhere(
|
@@ -813,8 +820,8 @@ public static function hideFromSessionCatalogCondition($qb)
|
813 | 820 | 's',
|
814 | 821 | $qb3
|
815 | 822 | ->select('s3')
|
816 |
| - ->from('ChamiloCoreBundle:ExtraFieldValues', 'fv') |
817 |
| - ->innerJoin('ChamiloCoreBundle:Session', 's3', Join::WITH, 'fv.itemId = s3.id') |
| 823 | + ->from(ExtraFieldValues::class, 'fv') |
| 824 | + ->innerJoin(Session::class, 's3', Join::WITH, 'fv.itemId = s3.id') |
818 | 825 | ->where(
|
819 | 826 | $qb->expr()->eq('fv.field', $extraFieldInfo['id'])
|
820 | 827 | )->andWhere(
|
@@ -845,33 +852,33 @@ public static function browseSessionsByTags($termTag, array $limit, $getCount =
|
845 | 852 |
|
846 | 853 | $qb->select('s')
|
847 | 854 | ->distinct()
|
848 |
| - ->from('ChamiloCoreBundle:Session', 's') |
| 855 | + ->from(Session::class, 's') |
849 | 856 | ->innerJoin(
|
850 |
| - 'ChamiloCoreBundle:SessionRelCourse', |
| 857 | + SessionRelCourse::class, |
851 | 858 | 'src',
|
852 | 859 | Join::WITH,
|
853 | 860 | 's.id = src.session'
|
854 | 861 | )
|
855 | 862 | ->innerJoin(
|
856 |
| - 'ChamiloCoreBundle:AccessUrlRelSession', |
| 863 | + AccessUrlRelSession::class, |
857 | 864 | 'url',
|
858 | 865 | Join::WITH,
|
859 | 866 | 'url.sessionId = s.id'
|
860 | 867 | )
|
861 | 868 | ->innerJoin(
|
862 |
| - 'ChamiloCoreBundle:ExtraFieldRelTag', |
| 869 | + ExtraFieldRelTag::class, |
863 | 870 | 'frt',
|
864 | 871 | Join::WITH,
|
865 | 872 | 'src.course = frt.itemId'
|
866 | 873 | )
|
867 | 874 | ->innerJoin(
|
868 |
| - 'ChamiloCoreBundle:Tag', |
| 875 | + Tag::class, |
869 | 876 | 't',
|
870 | 877 | Join::WITH,
|
871 | 878 | 'frt.tagId = t.id'
|
872 | 879 | )
|
873 | 880 | ->innerJoin(
|
874 |
| - 'ChamiloCoreBundle:ExtraField', |
| 881 | + ExtraField::class, |
875 | 882 | 'f',
|
876 | 883 | Join::WITH,
|
877 | 884 | 'frt.fieldId = f.id'
|
@@ -921,15 +928,15 @@ public static function getSessionsByName($keyword, array $limit, $getCount = fal
|
921 | 928 |
|
922 | 929 | $qb->select('s')
|
923 | 930 | ->distinct()
|
924 |
| - ->from('ChamiloCoreBundle:Session', 's') |
| 931 | + ->from(Session::class, 's') |
925 | 932 | ->innerJoin(
|
926 |
| - 'ChamiloCoreBundle:SessionRelCourse', |
| 933 | + SessionRelCourse::class, |
927 | 934 | 'src',
|
928 | 935 | Join::WITH,
|
929 | 936 | 's.id = src.session'
|
930 | 937 | )
|
931 | 938 | ->innerJoin(
|
932 |
| - 'ChamiloCoreBundle:AccessUrlRelSession', |
| 939 | + AccessUrlRelSession::class, |
933 | 940 | 'url',
|
934 | 941 | Join::WITH,
|
935 | 942 | 'url.sessionId = s.id'
|
@@ -1563,16 +1570,16 @@ public static function getFormattedSessionsBlock(array $sessions)
|
1563 | 1570 | $userId = api_get_user_id();
|
1564 | 1571 | $sessionsBlocks = [];
|
1565 | 1572 | $entityManager = Database::getManager();
|
1566 |
| - $sessionRelCourseRepo = $entityManager->getRepository('ChamiloCoreBundle:SessionRelCourse'); |
1567 |
| - $extraFieldRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraField'); |
| 1573 | + $sessionRelCourseRepo = $entityManager->getRepository(SessionRelCourse::class); |
| 1574 | + $extraFieldRepo = $entityManager->getRepository(ExtraField::class); |
1568 | 1575 | $tagRepo = Container::getTagRepository();
|
1569 | 1576 |
|
1570 | 1577 | $tagsField = $extraFieldRepo->findOneBy([
|
1571 |
| - 'itemType' => Chamilo\CoreBundle\Entity\ExtraField::COURSE_FIELD_TYPE, |
| 1578 | + 'itemType' => ExtraField::COURSE_FIELD_TYPE, |
1572 | 1579 | 'variable' => 'tags',
|
1573 | 1580 | ]);
|
1574 | 1581 |
|
1575 |
| - /** @var \Chamilo\CoreBundle\Entity\Session $session */ |
| 1582 | + /** @var Session $session */ |
1576 | 1583 | foreach ($sessions as $session) {
|
1577 | 1584 | $sessionDates = SessionManager::parseSessionDates([
|
1578 | 1585 | 'display_start_date' => $session->getDisplayStartDate(),
|
@@ -1610,7 +1617,7 @@ public static function getFormattedSessionsBlock(array $sessions)
|
1610 | 1617 | }
|
1611 | 1618 |
|
1612 | 1619 | /** @var SequenceResourceRepository $repo */
|
1613 |
| - $repo = $entityManager->getRepository('ChamiloCoreBundle:SequenceResource'); |
| 1620 | + $repo = $entityManager->getRepository(SequenceResource::class); |
1614 | 1621 | $sequences = $repo->getRequirementsAndDependenciesWithinSequences(
|
1615 | 1622 | $session->getId(),
|
1616 | 1623 | SequenceResource::SESSION_TYPE
|
|
0 commit comments