| @@ 10134-10145 (lines=12) @@ | ||
| 10131 | /** |
|
| 10132 | * @param int $id |
|
| 10133 | */ |
|
| 10134 | public static function moveUpCategory($id) |
|
| 10135 | { |
|
| 10136 | $em = Database::getManager(); |
|
| 10137 | /** @var CLpCategory $item */ |
|
| 10138 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10139 | if ($item) { |
|
| 10140 | $position = $item->getPosition() - 1; |
|
| 10141 | $item->setPosition($position); |
|
| 10142 | $em->persist($item); |
|
| 10143 | $em->flush(); |
|
| 10144 | } |
|
| 10145 | } |
|
| 10146 | ||
| 10147 | /** |
|
| 10148 | * @param int $id |
|
| @@ 10150-10161 (lines=12) @@ | ||
| 10147 | /** |
|
| 10148 | * @param int $id |
|
| 10149 | */ |
|
| 10150 | public static function moveDownCategory($id) |
|
| 10151 | { |
|
| 10152 | $em = Database::getManager(); |
|
| 10153 | /** @var CLpCategory $item */ |
|
| 10154 | $item = $em->find('ChamiloCourseBundle:CLpCategory', $id); |
|
| 10155 | if ($item) { |
|
| 10156 | $position = $item->getPosition() + 1; |
|
| 10157 | $item->setPosition($position); |
|
| 10158 | $em->persist($item); |
|
| 10159 | $em->flush(); |
|
| 10160 | } |
|
| 10161 | } |
|
| 10162 | ||
| 10163 | /** |
|
| 10164 | * @param int $courseId |
|