@@ 10110-10121 (lines=12) @@ | ||
10107 | /** |
|
10108 | * @param int $id |
|
10109 | */ |
|
10110 | public static function moveUpCategory($id) |
|
10111 | { |
|
10112 | $em = Database::getManager(); |
|
10113 | /** @var CLpCategory $item */ |
|
10114 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10115 | if ($item) { |
|
10116 | $position = $item->getPosition() - 1; |
|
10117 | $item->setPosition($position); |
|
10118 | $em->persist($item); |
|
10119 | $em->flush(); |
|
10120 | } |
|
10121 | } |
|
10122 | ||
10123 | /** |
|
10124 | * @param int $id |
|
@@ 10126-10137 (lines=12) @@ | ||
10123 | /** |
|
10124 | * @param int $id |
|
10125 | */ |
|
10126 | public static function moveDownCategory($id) |
|
10127 | { |
|
10128 | $em = Database::getManager(); |
|
10129 | /** @var CLpCategory $item */ |
|
10130 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10131 | if ($item) { |
|
10132 | $position = $item->getPosition() + 1; |
|
10133 | $item->setPosition($position); |
|
10134 | $em->persist($item); |
|
10135 | $em->flush(); |
|
10136 | } |
|
10137 | } |
|
10138 | ||
10139 | /** |
|
10140 | * @param int $courseId |