| @@ 10094-10105 (lines=12) @@ | ||
| 10091 | /** |
|
| 10092 | * @param int $id |
|
| 10093 | */ |
|
| 10094 | public static function moveUpCategory($id) |
|
| 10095 | { |
|
| 10096 | $em = Database::getManager(); |
|
| 10097 | /** @var CLpCategory $item */ |
|
| 10098 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10099 | if ($item) { |
|
| 10100 | $position = $item->getPosition() - 1; |
|
| 10101 | $item->setPosition($position); |
|
| 10102 | $em->persist($item); |
|
| 10103 | $em->flush(); |
|
| 10104 | } |
|
| 10105 | } |
|
| 10106 | ||
| 10107 | /** |
|
| 10108 | * @param int $id |
|
| @@ 10110-10121 (lines=12) @@ | ||
| 10107 | /** |
|
| 10108 | * @param int $id |
|
| 10109 | */ |
|
| 10110 | public static function moveDownCategory($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 $courseId |
|