@@ 310-332 (lines=23) @@ | ||
307 | ||
308 | $parsed = explode('-', $value); |
|
309 | ||
310 | if (count($parsed) > 3) { |
|
311 | $pageFrom = $this->em->getRepository('WebCMS\Entity\Page')->find($parsed[0]); |
|
312 | $moduleName = $parsed[1]; |
|
313 | $presenter = $parsed[2]; |
|
314 | $function = $parsed[3]; |
|
315 | ||
316 | $boxAssign->setBox($box); |
|
317 | $boxAssign->setFunction($function); |
|
318 | $boxAssign->setModuleName($moduleName); |
|
319 | $boxAssign->setPresenter($presenter); |
|
320 | $boxAssign->setPageFrom($pageFrom); |
|
321 | $boxAssign->setPageTo($pageTo); |
|
322 | ||
323 | if (!$boxAssign->getId()) { |
|
324 | $this->em->persist($boxAssign); |
|
325 | } |
|
326 | ||
327 | $this->em->persist($boxAssign); |
|
328 | } else { |
|
329 | if (is_object($exists)) { |
|
330 | $this->em->remove($exists); |
|
331 | } |
|
332 | } |
|
333 | ||
334 | $this->em->flush(); |
|
335 | ||
@@ 363-384 (lines=22) @@ | ||
360 | ||
361 | $parsed = explode('-', $value); |
|
362 | ||
363 | if (count($parsed) > 3) { |
|
364 | $pageFrom = $this->em->getRepository('WebCMS\Entity\Page')->find($parsed[0]); |
|
365 | $moduleName = $parsed[1]; |
|
366 | $presenter = $parsed[2]; |
|
367 | $function = $parsed[3]; |
|
368 | ||
369 | $boxAssign->setBox($box); |
|
370 | $boxAssign->setFunction($function); |
|
371 | $boxAssign->setModuleName($moduleName); |
|
372 | $boxAssign->setPresenter($presenter); |
|
373 | $boxAssign->setPageFrom($pageFrom); |
|
374 | ||
375 | if (!$boxAssign->getId()) { |
|
376 | $this->em->persist($boxAssign); |
|
377 | } |
|
378 | ||
379 | $this->em->persist($boxAssign); |
|
380 | } else { |
|
381 | if (!$exists->isEmpty()) { |
|
382 | $this->em->remove($boxInfo[0]); |
|
383 | } |
|
384 | } |
|
385 | ||
386 | $this->em->flush(); |
|
387 |