Advertisement
Guest User

empty parse error 5.4

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. zuvor:
  2. public function jsonSerialize()
  3. {
  4. $virtual = [
  5. 'bAktiv' => $this->{"bAktiv"}
  6. ];
  7. $override = [
  8. 'cName' => $this->getName(),
  9. 'kArtikel' => $this->getArtikelKey(),
  10. 'cBeschreibung' => !empty($this->getKurzBeschreibung())
  11. ? $this->getKurzBeschreibung()
  12. : $this->getBeschreibung(),
  13. 'bAnzahl' => $this->getMin() != $this->getMax(),
  14. 'fInitial' => (float) $this->getInitial(),
  15. 'fMin' => (float) $this->getMin(),
  16. 'fMax' => (float) $this->getMax(),
  17. 'cBildPfad' => $this->getBildPfad(),
  18. 'fPreis' => [
  19. (float) $this->getPreis(),
  20. (float) $this->getPreis(true)
  21. ],
  22. 'fPreisLocalized' => [
  23. gibPreisStringLocalized($this->getPreis()),
  24. gibPreisStringLocalized($this->getPreis(true))
  25. ]
  26. ];
  27. $result = array_merge($override, $virtual);
  28. return utf8_convert_recursive($result);
  29. }
  30.  
  31. neu:
  32. public function jsonSerialize()
  33. {
  34. $cKurzBeschreibung = $this->getKurzBeschreibung();
  35. $virtual = [
  36. 'bAktiv' => $this->{"bAktiv"}
  37. ];
  38. $override = [
  39. 'cName' => $this->getName(),
  40. 'kArtikel' => $this->getArtikelKey(),
  41. 'cBeschreibung' => !empty($cKurzBeschreibung)
  42. ? $this->getKurzBeschreibung()
  43. : $this->getBeschreibung(),
  44. 'bAnzahl' => $this->getMin() != $this->getMax(),
  45. 'fInitial' => (float) $this->getInitial(),
  46. 'fMin' => (float) $this->getMin(),
  47. 'fMax' => (float) $this->getMax(),
  48. 'cBildPfad' => $this->getBildPfad(),
  49. 'fPreis' => [
  50. (float) $this->getPreis(),
  51. (float) $this->getPreis(true)
  52. ],
  53. 'fPreisLocalized' => [
  54. gibPreisStringLocalized($this->getPreis()),
  55. gibPreisStringLocalized($this->getPreis(true))
  56. ]
  57. ];
  58. $result = array_merge($override, $virtual);
  59. return utf8_convert_recursive($result);
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement