@@ 10242-10253 (lines=12) @@ | ||
10239 | /** |
|
10240 | * @param int $id |
|
10241 | */ |
|
10242 | public static function moveUpCategory($id) |
|
10243 | { |
|
10244 | $em = Database::getManager(); |
|
10245 | /** @var CLpCategory $item */ |
|
10246 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10247 | if ($item) { |
|
10248 | $position = $item->getPosition() - 1; |
|
10249 | $item->setPosition($position); |
|
10250 | $em->persist($item); |
|
10251 | $em->flush(); |
|
10252 | } |
|
10253 | } |
|
10254 | ||
10255 | /** |
|
10256 | * @param int $id |
|
@@ 10258-10269 (lines=12) @@ | ||
10255 | /** |
|
10256 | * @param int $id |
|
10257 | */ |
|
10258 | public static function moveDownCategory($id) |
|
10259 | { |
|
10260 | $em = Database::getManager(); |
|
10261 | /** @var CLpCategory $item */ |
|
10262 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10263 | if ($item) { |
|
10264 | $position = $item->getPosition() + 1; |
|
10265 | $item->setPosition($position); |
|
10266 | $em->persist($item); |
|
10267 | $em->flush(); |
|
10268 | } |
|
10269 | } |
|
10270 | ||
10271 | /** |
|
10272 | * @param int $courseId |