@@ 10199-10210 (lines=12) @@ | ||
10196 | /** |
|
10197 | * @param int $id |
|
10198 | */ |
|
10199 | public static function moveUpCategory($id) |
|
10200 | { |
|
10201 | $em = Database::getManager(); |
|
10202 | /** @var CLpCategory $item */ |
|
10203 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10204 | if ($item) { |
|
10205 | $position = $item->getPosition() - 1; |
|
10206 | $item->setPosition($position); |
|
10207 | $em->persist($item); |
|
10208 | $em->flush(); |
|
10209 | } |
|
10210 | } |
|
10211 | ||
10212 | /** |
|
10213 | * @param int $id |
|
@@ 10215-10226 (lines=12) @@ | ||
10212 | /** |
|
10213 | * @param int $id |
|
10214 | */ |
|
10215 | public static function moveDownCategory($id) |
|
10216 | { |
|
10217 | $em = Database::getManager(); |
|
10218 | /** @var CLpCategory $item */ |
|
10219 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
10220 | if ($item) { |
|
10221 | $position = $item->getPosition() + 1; |
|
10222 | $item->setPosition($position); |
|
10223 | $em->persist($item); |
|
10224 | $em->flush(); |
|
10225 | } |
|
10226 | } |
|
10227 | ||
10228 | /** |
|
10229 | * @param int $courseId |