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