| @@ 10188-10199 (lines=12) @@ | ||
| 10185 | /** |
|
| 10186 | * @param int $id |
|
| 10187 | */ |
|
| 10188 | public static function moveUpCategory($id) |
|
| 10189 | { |
|
| 10190 | $em = Database::getManager(); |
|
| 10191 | /** @var CLpCategory $item */ |
|
| 10192 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10193 | if ($item) { |
|
| 10194 | $position = $item->getPosition() - 1; |
|
| 10195 | $item->setPosition($position); |
|
| 10196 | $em->persist($item); |
|
| 10197 | $em->flush(); |
|
| 10198 | } |
|
| 10199 | } |
|
| 10200 | ||
| 10201 | /** |
|
| 10202 | * @param int $id |
|
| @@ 10204-10215 (lines=12) @@ | ||
| 10201 | /** |
|
| 10202 | * @param int $id |
|
| 10203 | */ |
|
| 10204 | public static function moveDownCategory($id) |
|
| 10205 | { |
|
| 10206 | $em = Database::getManager(); |
|
| 10207 | /** @var CLpCategory $item */ |
|
| 10208 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10209 | if ($item) { |
|
| 10210 | $position = $item->getPosition() + 1; |
|
| 10211 | $item->setPosition($position); |
|
| 10212 | $em->persist($item); |
|
| 10213 | $em->flush(); |
|
| 10214 | } |
|
| 10215 | } |
|
| 10216 | ||
| 10217 | /** |
|
| 10218 | * @param int $courseId |
|