| @@ 123-139 (lines=17) @@ | ||
| 120 | /** |
|
| 121 | * @param array $notices |
|
| 122 | */ |
|
| 123 | public function remove(array $notices) |
|
| 124 | { |
|
| 125 | $ids = []; |
|
| 126 | /* @var $notice NoticeEntity */ |
|
| 127 | foreach ($notices as $notice) { |
|
| 128 | $ids[] = $notice->getId(); |
|
| 129 | } |
|
| 130 | ||
| 131 | $this->_em |
|
| 132 | ->createQuery(' |
|
| 133 | DELETE FROM |
|
| 134 | AnimeDbAppBundle:Notice n |
|
| 135 | WHERE |
|
| 136 | n.id IN (:ids)' |
|
| 137 | ) |
|
| 138 | ->setParameter('ids', $ids) |
|
| 139 | ->execute(); |
|
| 140 | } |
|
| 141 | ||
| 142 | /** |
|
| @@ 146-165 (lines=20) @@ | ||
| 143 | * @param array $notices |
|
| 144 | * @param string $status |
|
| 145 | */ |
|
| 146 | public function setStatus(array $notices, $status) |
|
| 147 | { |
|
| 148 | $ids = []; |
|
| 149 | /* @var $notice NoticeEntity */ |
|
| 150 | foreach ($notices as $notice) { |
|
| 151 | $ids[] = $notice->getId(); |
|
| 152 | } |
|
| 153 | ||
| 154 | $this->getEntityManager() |
|
| 155 | ->createQuery(' |
|
| 156 | UPDATE |
|
| 157 | AnimeDbAppBundle:Notice n |
|
| 158 | SET |
|
| 159 | n.status = :status |
|
| 160 | WHERE |
|
| 161 | n.id IN (:ids) |
|
| 162 | ') |
|
| 163 | ->setParameter('ids', $ids) |
|
| 164 | ->setParameter('status', $status) |
|
| 165 | ->execute(); |
|
| 166 | } |
|
| 167 | ||
| 168 | /** |
|