| @@ 10962-10973 (lines=12) @@ | ||
| 10959 | /** |
|
| 10960 | * @param int $id |
|
| 10961 | */ |
|
| 10962 | public static function moveUpCategory($id) |
|
| 10963 | { |
|
| 10964 | $em = Database::getManager(); |
|
| 10965 | /** @var CLpCategory $item */ |
|
| 10966 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10967 | if ($item) { |
|
| 10968 | $position = $item->getPosition() - 1; |
|
| 10969 | $item->setPosition($position); |
|
| 10970 | $em->persist($item); |
|
| 10971 | $em->flush(); |
|
| 10972 | } |
|
| 10973 | } |
|
| 10974 | ||
| 10975 | /** |
|
| 10976 | * @param int $id |
|
| @@ 10978-10989 (lines=12) @@ | ||
| 10975 | /** |
|
| 10976 | * @param int $id |
|
| 10977 | */ |
|
| 10978 | public static function moveDownCategory($id) |
|
| 10979 | { |
|
| 10980 | $em = Database::getManager(); |
|
| 10981 | /** @var CLpCategory $item */ |
|
| 10982 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10983 | if ($item) { |
|
| 10984 | $position = $item->getPosition() + 1; |
|
| 10985 | $item->setPosition($position); |
|
| 10986 | $em->persist($item); |
|
| 10987 | $em->flush(); |
|
| 10988 | } |
|
| 10989 | } |
|
| 10990 | ||
| 10991 | /** |
|
| 10992 | * @param int $courseId |
|