| @@ 10908-10919 (lines=12) @@ | ||
| 10905 | /** |
|
| 10906 | * @param int $id |
|
| 10907 | */ |
|
| 10908 | public static function moveUpCategory($id) |
|
| 10909 | { |
|
| 10910 | $em = Database::getManager(); |
|
| 10911 | /** @var CLpCategory $item */ |
|
| 10912 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10913 | if ($item) { |
|
| 10914 | $position = $item->getPosition() - 1; |
|
| 10915 | $item->setPosition($position); |
|
| 10916 | $em->persist($item); |
|
| 10917 | $em->flush(); |
|
| 10918 | } |
|
| 10919 | } |
|
| 10920 | ||
| 10921 | /** |
|
| 10922 | * @param int $id |
|
| @@ 10924-10935 (lines=12) @@ | ||
| 10921 | /** |
|
| 10922 | * @param int $id |
|
| 10923 | */ |
|
| 10924 | public static function moveDownCategory($id) |
|
| 10925 | { |
|
| 10926 | $em = Database::getManager(); |
|
| 10927 | /** @var CLpCategory $item */ |
|
| 10928 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10929 | if ($item) { |
|
| 10930 | $position = $item->getPosition() + 1; |
|
| 10931 | $item->setPosition($position); |
|
| 10932 | $em->persist($item); |
|
| 10933 | $em->flush(); |
|
| 10934 | } |
|
| 10935 | } |
|
| 10936 | ||
| 10937 | /** |
|
| 10938 | * @param int $courseId |
|