@@ 146-166 (lines=21) @@ | ||
143 | private function getSeat($venue, $row, $venueSector, $place = null) |
|
144 | { |
|
145 | $em = $this->getConfigurationPool()->getContainer()->get('Doctrine')->getManager(); |
|
146 | if ($place === null) { |
|
147 | $seat = $em->getRepository('AppBundle:Seat')->findBy([ |
|
148 | 'row' => $row, |
|
149 | 'venueSector' => $venueSector, |
|
150 | ]); |
|
151 | if (!$seat) { |
|
152 | $this |
|
153 | ->getConfigurationPool() |
|
154 | ->getContainer() |
|
155 | ->get('session') |
|
156 | ->getFlashBag() |
|
157 | ->add( |
|
158 | 'error', |
|
159 | "Помилка. В залi $venue немає $row ряда в секторі $venueSector!" |
|
160 | ); |
|
161 | throw new ModelManagerException('Error row!'); |
|
162 | } |
|
163 | foreach ($seat as $placeAllInRow) { |
|
164 | self::validateSeat($row, $placeAllInRow->getPlace(), $venueSector); |
|
165 | } |
|
166 | } |
|
167 | if ($place !== null) { |
|
168 | $seat = $em->getRepository('AppBundle:Seat')->findOneBy([ |
|
169 | 'row' => $row, |
|
@@ 167-186 (lines=20) @@ | ||
164 | self::validateSeat($row, $placeAllInRow->getPlace(), $venueSector); |
|
165 | } |
|
166 | } |
|
167 | if ($place !== null) { |
|
168 | $seat = $em->getRepository('AppBundle:Seat')->findOneBy([ |
|
169 | 'row' => $row, |
|
170 | 'place' => $place, |
|
171 | 'venueSector' => $venueSector, |
|
172 | ]); |
|
173 | if (!$seat) { |
|
174 | $this |
|
175 | ->getConfigurationPool() |
|
176 | ->getContainer() |
|
177 | ->get('session') |
|
178 | ->getFlashBag() |
|
179 | ->add( |
|
180 | 'error', |
|
181 | "Помилка. В залi $venue немає $row - $place в секторі $venueSector!" |
|
182 | ); |
|
183 | throw new ModelManagerException('Error row-place!'); |
|
184 | } |
|
185 | self::validateSeat($row, $place, $venueSector); |
|
186 | } |
|
187 | } |
|
188 | ||
189 | private function getPlaces($venue, $row, $venueSector, $strPlaces) |